refactor ConnectionValidator and ConnectionValidatorTest