Improve life-cycle handlign