factor out comparisons, fudge quotes for ie8