Small refactoring to support inner exceptions