Lots of cleanup for an initial PR