Improve robustness and add lifecycle notification for clients