Move exception handling to application level