cleanup chap 5 wip