Refactor task execution in modules/projects