formatting and refactoring some things.