some styling and refactoring