refactored confirm.py