remove duplicate code
Merge pull request #515 from 3nids/duplicatecode

remove duplicate code