refact exception