remove duplicated code
Merge pull request #60 from hmatsuda/remove-duplicated-code

remove duplicated code