Refactor evaluateBoolExpr to be slightly quicker.