week 5 refactoring