chp 5 exercises, refactoring tests