Refactor logic for deleting widgets to rely on model