Lifecycle callbacks are added.