Refactor confirm helper