Some styling and refactoring