Added validity functions to all classes