Format and refactor