minor refactoring
code organizing