protected function saveTemplateOptions(array $properties = null)
    {
        if ($properties === null) {
            $properties = $this->defaultTemplateProperties();
        }

        if ($this->areTemplateOptionsFinalized === false) {
            $this->areTemplateOptionsFinalized = true;
            $this->prepareTemplateOptions();
        }

        $key  = 'template_options';
        $prop = $this->property($key);
        $prop->setStructureMetadata($this->templateOptionsMetadata());
    }