Performance improvements and fiddling.
perf improvements