some code style refactoring