Code refactoring and formatting.