Refactoring to improve code formatting