styling and refactoring