Code review; Refactoring; Add confirmation dialog to delete function