reconnect; refactored