Removed unnecessary code

As requested in PR #5848.