Refactored createTaskQueue into seperate module and two composed functions