Updating function from steps_controller to Task model