refactoring of reference resolver, cleaned up serializers