Refactor exceptions.