entity serializer refactoring