Part out connection logic into separate methods