reuse more code in Mojo::DOM