Reworked connection testing to be more efficient