First part of splitting out document() view into logical bits.