better model type casting