Replaced the switch statement with domain lookup with an if statement to escape the linked-list crawl earlier