Improve the model refresh logic