CIDR refactors
set the domain if it is empty
ensure the domains are properly set; refactor related code
fix specs