Create BaseModel class to avoid code duplication