refactor util.dom