refactor tasks