Refactored generic application controller exception handler