Updates and fixes found during chapter writing time

Mostly cleanup - typos, refactorings, insights and ideas that came up during the chapter writing