Maybe copy the logic for using `util._extend` used in domain.js?