Refactored TasksController to remove repetition via 'before' action and private params