We explicitly aren't using the DOM at all here, so I think we can simplify this whole thing a lot.