Improved widget lifecycle