More use of DocumentApi (and HasText)