Structural work for #32

Probably broken some stuff in passing