refactor phase_2