significant improvements to reconnect logic