Better domain detection