Creating method of shutdown actions

Lowering repetition and increasing reusability