Refactored idref-with-content exception checking code.