Implements simple validation machanism