refactor of phase 3 again!