Error handling, confirmation, and cleanup.