moves the try/catch outside

let’s avoid unnecessary nested indentations
code makeup