refactoring some code
Merge pull request #1 from bdeining/dev

refactoring some code