Put the verify method in a central place, prevent it being copy and pasted all over the place. see issue #227