styling and code refactoring