refactor(events): no more events in lib
refactor(task): split up and initialize inside the module
refactor(task): externalize state
refactor(task): externalize state in helpers