codeReview: Refactored Exception handling