TODO: make HTMLElement a typeclass instead?