you could also just check the `doc_type` and not have to go back to the DB for the remote apps, but probably not a huge savings there.