refactoring exception case classes