More styling cleanup and refactoring