updates to control when and how the application is exited.