refactored validator.java
Validator.java refactored