refactored Delete and Insert operations