tweaks of refactor in chap 3