enhanced the usage of StringValidator.