improved router with domain support. Testing