Broke out connection logic to its own, separate methods