refactor task phase.