updating Validate class and some unit test cases around it