Refactoring app/controllers/a_provinsis_controller.rb