use switch case for domain detection