remove duplicate code
Merge pull request #8 from ysksn/master

remove duplicate code