Refactor Life sample.