refactored verifier to be parameterized on two types