Refactored connectHypervisor