Refactoring relationship controller