Refactoring and some styling.