Move view-lifecycle codes to separate category.