Refactoring - exception in integration app