Faster selectByClass and hasClass