tasks refactor