refactor the BaseModel