Refactor creating Tasks