Improve deletion to remove elements from dataset