more reformatting/refactoring