Cleanup exception handling code