refactor task_controller