just to 100% confirm - doc is definitely a `Document` and not a `dict` here right?