Refactor serializer to use class and string names.