Refine Sample Code of Lifecycle Module