Remove duplicate code in the CrashHandler