Simplified code by eliminating setHashFromExpr()