A bit more code cleanups. I think I'm mostly done for now.