partial refactoring to citation and external id for study references