cut out validation feature into plugin