simplify shutdown hooks