Optimization of the remove