Style change and minor refactoring