chapter 8 exercise refactors