General purpose validation framework