Refactored some methods in action_controller_helpers