Rework crashhandling to be saner code-wise