Semantic refactoring and cleanup for styling.