added validation class and used closures for data rules