refactor task.done