code refactoring for validation of validateVersion