Task refactoring