Lots of stylistic changes and cleanup