Remove duplicate code
Merge pull request #1456 from cdevienne/1.5-branch

Remove duplicate code