exception refactoring.