Pull out validation logic for generics based validators