refactor tasks structure