validation class and exceptions