public static function create_declared_model(array $definition): \core_analytics\model {

        list($target, $indicators) = static::get_declared_target_and_indicators_instances($definition);

        if (isset($definition['timesplitting'])) {
            $timesplitting = $definition['timesplitting'];
        } else {
            $timesplitting = false;
        }

        $created = \core_analytics\model::create($target, $indicators, $timesplitting);

        if (!empty($definition['enabled'])) {
            $created->enable();
        }

        return $created;
    }