refactored version validator.