It might be possible to simplify both this and the parent methods by only inserting the elements if they haven't been previously set, but that would take some testing.