some minor code style refactoring