Refactor duplicate code into RelationObjectConfigure