Implemement replaceExistingShapes