Refactor tasks