refactor exception class