Refactor with a before action filter