Refactoring cert host verifier