use existing utlity function to get documents - careful to iterate only once