Added state machine to ESL.Client instead of boolean flags.