Extract deftask macro
Refactor tasks scheduling