and it could be simpler to using only one try block