refactored exception class