Dynamic determination of the model type