Using only DOM elements to create checks. This should help avoid errors due to comment nodes being passed to the factory method.