Spatial optimizations and tidy-up