Lots of cleanups and reformats.