[Refactoring] Remove the hack code introduced in #1760

AST identity issue has been properly fixed in #3383 (fceb16bbf7).