Refactor ConnectivityTester and cleanup