Refactor cancel_plan! logic