Reworked tasks and subtasks logic