Avoid check for element by using a more specific type: Element.