Refactor in deleting schedule with confirmation dialog box