Task refactor