task refactor