Refactor begin_and_rescue blocks