cleaned up shutdown order of operations (should be reverse of startup)