I can't figure out why you made these changes in this function. Can you tell me what this adds? Seems like a lot of redundant calculations as we already have the countryCode at this point, but instead triggering a keyup will have to search through all the country data to find it again, and also we're setting the active/highlight classes twice.