Moving shutdown code into the ha common class