Do we need the second parameter, dom? It seems to be unused.

On a second thought, do we need this function at all? It seems so simple now that perhaps it could be inlined