refactor code part 1
Merge pull request #4 from wyixin/master

refactor code #1