refactor relationship_controller