milestone 7 -- refactoring