refactored guts of pdb file association code