code improvements for Domain validator