Move shutdown hook to its own class