optimizing the search for existing links by replacing the Link object with dictionary look up