adding style and refactoring