domain_id class logic simplified