refactoring homework4