move try/catch to methods