moving the retrieval of the annotations out of the recursion