Refactor TasksCtrl