chapter 5 commit 1
refactor tests
finish chapter 5