Simplify serializer code