Remove replaced code

Issue #2507