[WIP] Mild refactoring in the task system