total refactor pt 1