Refactor class checker to evaluate selector up front only once instead
of when checking every view