Added count functions in the model class