improved router with domain handler