Factor out document domain again