exception refactoring phase2