Ch6. Page 168 checkpoint, refactored into other files.