refactoring: simplify confirmation dialogs, remove duplicate code