Merge pull request #1 from nezirus/master
remove the duplicate code