Refactoring a_departments_controller.rb