Consalidated code- potentially able to remove ConnectThread?