updated find_links to separate functionality