serializer refactoring