Refactored response_controller.rb