refactored code style