Change the order of ins and del parameters, and simplify generator functions