style updates and refactoring