chp 9 exercises
refactor tests