Some task refactoring