Better lifecycle hook