Re-implement changes for #118 for new domain types