Make refactoring of JSON serialization/deserialization.