Refactored exceptions. Better disconnection handling