Better way to check for HTML nodes