slightly more straightforward logic in teardown for beforeShutdown event