factor out doc