exception refactor