refactor confirmation functions