cleanup DomUtil code