refactoring exceptions