refactored name_validator