Add lifecycle methods.