Refactor the code to move JSON representation logic to a separate interface instead of methods on each class.
Refactor the code to move JSON representation logic to a separate interface instead of methods on each class.