refactoring and styling