Serializer refactoring