Refactor Shutdown a little to reduce indentation Upstream-commit: e990eca1e5b73c4e87f2e3b18f52f3d9630a988b Component: engine