rescue refactor