some minor refactoring
some minor refactoring