optimize the exceptions