Refactored code style