refactoring serializers/deserializers