Reworked the TaskManager.