Moved business logic to the Task Model and out of the Controller.