removed duplicate code
Merge pull request #1206 from andreistefanescu/master

removed duplicate code