Chapter 8 exercises; mostly refactoring tests