Did some refactoring in RelationshipResolver