Miscellaneous reformatting/refactoring