refactor relationships_controller.rb