Memory performance improvement: avoid cloning at insert and delete when possible.