separated out getting document from processing it