@nickpell this is too implicit—better would be

```python
try:
    xform_json = XFormInstance.get_db().get(id)  # this gets the json without wrapping it
except ResourceNotFound:
    raise Http404()

if xform_json.get('doc_type') not in ALLOWED_XFORM_DOCTYPES:
    raise Http404()
return XFormInstance.wrap(xform_json)
```

Not sure anything like `ALLOWED_XFORM_DOCTYPES` is defined in one place, but you should search for `'XFormInstance'` (with the quotes) in the code base and see if you can fine a list of doc_types