refactor task