refactor transaction confirmation