Doing refactor for task.