Refactoring of the architecture of the taskManager

Minimize coupling, make clearer the chain of responsibilities