Refactor constant folding for CondStmt