improve model api