Style changes and refactoring