Logical cleanup of error handling code.