Added a simple and extensible validator class to set rules