Extract graceful_close