Refactored Exception Handling