Reworked connection logic to use new ConnectionManager