Refactoring exception chaining