refactoring stuff -- mostly formatting