remove no longer needed code
refactor bShutdownImmediate handling