It currently relies on the document, but it's not the right reference since the context is the handling of a received message which produce a new/updated document.