Lots of cleanups