exception refactoring phase1