Refactor dom/decorate slightly.