D-14567 Refactored try catch blocks