Simplify nested try block