Refactored. Removes duplicate affiliations