Added helper method to setup a connection.