refactoring stage 1 complete