TaskManager Refactoring