refactored controller and set before_action