cleanup
performance tuning for in-place editing