Move redundant code to befor_action method