exceptions refactoring