chap 9 & 'refactor' of sorts