Some refactoring/reformatting.