Introducing a common base class for erase and insert actions