Major rearrangement of code to make stuff easier to find by example