Refactoring and Formatting