Refactor connect inside startHelper() and fix infinite recursion

Authored by shubham on Aug 20 2019, 3:17 PM.