Moved connection logic to it's own method