Another refactoring that features common serializer interface.