refactor phase 1

not working yet