Move connect functionality out of init and into its own method