Generalize verify() method.