
826 So.2d 144 (2001)
Billy Jack TINDLE
v.
STATE FARM GENERAL INSURANCE COMPANY and State Farm Fire and Casualty Company.
2991056.
Court of Civil Appeals of Alabama.
May 25, 2001.
Rehearing Denied July 27, 2001.
*145 J. Gusty Yearout and John G. Watts of Yearout, Myers & Traylor, P.C., Birmingham, for appellant.
Bert S. Nettles and Brennan C. Ohme of London & Yancey, L.L.C., Birmingham, for appellees.

On Application for Rehearing
CRAWLEY, Judge.
The opinion of January 12, 2001, is withdrawn, and the following is substituted therefor.
In September 1998, Billy Jack Tindle, as a representative member of a class of similarly situated persons, sued State Farm General Insurance Company, Inc., alleging that State Farm had overcharged him for home-insurance premiums since 1984. Tindle alleged that the overcharges support *146 a breach-of-contract claim and equitable claims of unjust enrichment and money had and received against State Farm. State Farm filed a motion to dismiss, pursuant to Rule 12(b)(1) and (6), Ala. R. Civ. P. State Farm argued that the trial court did not have jurisdiction to address the issue whether State Farm had overcharged Tindle for his home-insurance premiums. State Farm argued that Tindle was required to argue the issue whether State Farm overcharged him before the State Insurance Commission, before the trial court would have jurisdiction; therefore, State Farm argued that that claim was due to be dismissed pursuant to Rule 12(b)(1). State Farm argued that because the overcharge issue had to be pursued before the Insurance Commission, Tindle could not possibly prevail on the breach-of-contract, unjust-enrichment, and money-had-and-received claims and that they were therefore due to be dismissed pursuant to Rule 12(b)(6). The trial court granted the motion stating:
"The court finds that this [overcharge] matter is proper for adjudication before the Commissioner of Insurance of the State of Alabama. [This claim] must be first addressed by the administrative vehicle provided by the Insurance Code and [it] is hereby dismissed pursuant to A.R.C.P., Rule 12(b)(1). The remaining claims for breach of contract, unjust enrichment, and money had and received are dismissed pursuant to Rule 12(b)(6), A.R.C.P."
Tindle filed a postjudgment motion, which the trial court denied. Tindle appealed to the supreme court, which transferred the case to this court, pursuant to Ala.Code 1975, § 12-2-7(6).
State Farm has insured Tindle's residence for approximately 20 years. The residence is located in a semi-rural area of western Jefferson County. For several years, the fire protection available for Tindle's residence was provided by a volunteer fire department located in the community of Concord. In 1991, the Birmingport Fire District was created, to provide Tindle's area with professional, rather than volunteer, fire protection. State Farm follows standard guidelines in assessing the risks for insuring residences based on the kind of fire protection available to a residence. The guidelines provide for 10 fire-protection classes. Class 1 is the best fire-protection class, and class 10 is the worst fire-protection class. Before the creation of the Birmingport Fire District, Tindle's residence was rated in class 10.
State Farm commenced a review of the fire-protection classifications of its insureds in 1997; it calls this review the "current business review." State Farm hired Insurance Services Offices, Inc. ("ISO"), to perform the technical aspects of the current business review. ISO determined that Tindle, along with other insureds, had been wrongly classified in a class-10 fire-protection area; State Farm accepted that determination. State Farm ultimately determined that Tindle was located in a class-9 fire-protection area and sent him a check for $2,778.99, representing an overcharge of premiums for the years 1994 through 1998.
Tindle disputed two aspects of State Farm's calculation of the overcharged premium. First, he contended that he should be given a refund for excess premiums paid in years 1991 through 1993 as well, because his improved fire-protection had commenced in 1991 with the creation of the Birmingport Fire District. Tindle also disputed his current class-9 fire-protection classification. The guidelines used by State Farm to establish the fire-protection classifications provide that a residence located in a fire-protection area like the Birmingport Fire District would be in a *147 class-7 fire-protection area if the residence is within 1,000 feet of a fire hydrant but would be in a class-9 fire-protection area if the residence is more than 1,000 feet from a fire hydrant. Tindle presented evidence indicating that a straight line from the nearest fire hydrant to his house is less than 1,000 feet. State Farm presented evidence indicating that a straight-line measurement is not appropriate for determining the distance between Tindle's residence and a fire hydrant and that what it considers the appropriate method of measurement indicates that Tindle's residence is more than 1,000 feet from a fire hydrant.
Tindle argues that his case is similar to thousands of legal actions that he says have been brought against insurers by their insureds to dispute the amount of premium owed pursuant to insurance contracts. State Farm contends that this is not "merely" a dispute over the amount of a premium. State Farm contends that Tindle disagrees with its method of determining the fire-protection classification of an insured, and that this dispute presents an issue that must be addressed to the insurance company (and, State Farm concedes, Tindle has exhausted his remedies within the State Farm system) and then to the insurance commissioner. We conclude that State Farm is correct and that the trial court properly dismissed Tindle's action because it does not have subject-matter jurisdiction over that action. We conclude that the issue whether State Farm owes Tindle a premium refund for 1991 through 1993 is dependent on the correct method for determining the fire-protection classification of Tindle's property and, therefore, that that issue must also be addressed by the insurance commissioner before the trial court can have jurisdiction to address it.
No Alabama cases have addressed the issue in this case. Ala.Code 1975, § 27-13-1 et seq., governs the rates an insurer may charge an insured. Section 27-13-1 states that the purpose of the statutory scheme is "to promote the public welfare by regulating insurance rates to the end that they shall not be excessive, inadequate or unfairly discriminatory." Section 27-13-2 states that the insurance commissioner is "charged with the duty of the administration of all laws now relating, or hereafter relating, to insurance rates and rating systems." There is no dispute that State Farm's homeowner's insurance is subject to regulation by the insurance commissioner. The commissioner has broad powers, including, but not limited to, the power to require insurers to submit data to aid him in performing his duties (§ 27-13-3); to promulgate rules and regulations necessary to enable him to perform his duties (§ 27-13-4); to license rating organizations (§ 27-13-24); to approve rating systems (§ 27-13-30); to periodically examine business practices and rating practices (§ 27-13-36); and to authorize rate changes (§ 27-13-33 and § 27-13-37).
Section 27-13-27 prescribes the methods and standards for rating systems:
"Every rating organization and every insurer which makes its own rates shall make rates that are not unreasonably high or inadequate for the safety or soundness of the insurer and which do not unfairly discriminate between risks in this state involving essentially the same hazards and shall, in rate-making and in making rating systems:
"(1) Adopt basis classifications, which shall be used as the basis of all manual, minimal, class, schedule or experience rates;
"(2) Adopt reasonable standards for construction, for protective facilities and for other conditions that materially affect the hazard or peril, which *148 shall be applied in the determination or fixing of rates;
"(3) Give consideration to past experience within the state and without the state when necessary, and due consideration may be given to prospective loss experience within the state and without the state when necessary, over such period of years as appears to be fairly representative of the frequency of the occurrence of the particular hazard or peril, including, where pertinent, the conflagration and catastrophe hazards, if any; and
"(4) Give consideration to all factors reasonably related to the kind of insurance involved, including a reasonable profit for the insurer and, in the case of participating insurers, to policyholders' dividends. In the case of fire insurance, consideration shall be given to the latest available experience of the fire insurance business, other than fire insurance covering motor vehicles, during a period of not less than five years preceding the year in which rates are made or revised."
State Farm's process for determining Tindle's fire-protection classification is governed by this section. As stated above, State Farm adopted ISO's basis classifications for fire protection. Tindle's argument that he merely disagrees with the amount of the premium charged by State Farm is not an accurate assessment of his dispute with State Farm. Rather, Tindle disagrees with the method by which State Farm determined his premium. Tindle is questioning how State Farm determined that his residence is in a class-9 fire-protection area instead of a class-7 fire-protection area. Tindle is questioning whether State Farm complied with § 27-13-27.
We conclude that § 27-13-32 provides the procedure for resolving Tindle's dispute with State Farm. That section states:
"Every rating organization, and every insurer which does its own rate-making, shall provide reasonable means within this state, to be approved by the department, whereby any person, or persons, affected by rate made by it may be heard on an application to reduce such rate. If such rating organization or such insurer shall refuse to reduce such rate, the person or persons affected thereby may make a like application to the commissioner within 30 days after receipt of notice in writing that the application for reduction of rate has been denied by such rating organization or by such insurer.... The commissioner shall fix a time and place for hearing on such application ... for the applicant and such rating organization or such insurer to be heard. The commissioner shall make such order as he shall deem just and lawful upon the evidence placed before him at such hearing."
(Emphasis added.)
We conclude that this section provides for the administrative review of a dispute such as Tindle's dispute with State Farm, before that dispute can come within the jurisdiction of the trial court. This section is akin to other statutes requiring administrative review before an action may be brought in a circuit court. See Ala.Code 1975, § 40-2A-7 (requiring administrative review in the Department of Revenue before one can proceed in the circuit court); § 41-22-20 (a provision of the Administrative Procedure Act requiring exhaustion of administrative remedies before proceeding to appeal to the circuit court).
Section 27-13-35 provides that the commissioner will consider certain factors to determine whether rates are reasonable. Section 27-13-43 provides for judicial review *149 of the commissioner's final order. Because the statutes provide for an administrative review of a dispute regarding a rating system such as State Farm's fire-protection classification, we conclude that the administrative review must be exhausted before the trial court can have jurisdiction over the dispute. It is only after the insurance commissioner, pursuant to § 27-13-32 and § 27-13-35, determines whether the rate is reasonable or nondiscriminatory, that, pursuant to § 27-13-43, an action may be filed in the circuit court.
Therefore, we conclude that the trial court properly dismissed Tindle's claims for lack of subject-matter jurisdiction.
APPLICATION GRANTED; OPINION OF JANUARY 12, 2001, WITHDRAWN; OPINION SUBSTITUTED; AFFIRMED.
THOMPSON and PITTMAN, JJ., concur.
YATES, P.J., and MURDOCK, J., dissent.
YATES, Presiding Judge, dissenting.
Because I believe the trial court erred in dismissing Tindle's claim, I must respectfully dissent. I agree with Tindle's characterization of this action as not being one claiming that an unreasonable rate was charged, but, rather, as one claiming that a reasonable rate was improperly applied to him. After reviewing the relevant provisions of § 27-2-1 et seq. and § 27-13-1 et seq., Ala.Code 1975, I conclude that those provisions do not apply to the particular facts of this case. Accordingly, I conclude that Tindle does not have to seek redress from the insurance commissioner before pursuing his action in the circuit court.
MURDOCK, Judge, dissenting.
Pursuant to § 27-13-32, Ala.Code 1975, insureds who believe their property has been wrongly classified by an insurer, resulting in a higher premium than would otherwise have been incorporated into their contract of insurance, may request a hearing before their insurance company to seek a reduction in their premium rate. That Code section further provides that, if the rate is not reduced as a result of such a request, "the person or persons affected thereby may make a like application to the [C]ommissioner [of Insurance]" (emphasis added) and that, following a hearing, the "commissioner shall make such order as he shall deem just and lawful." See also § 27-13-43 (providing that a final order of the commissioner "may ... be reviewed by the Circuit Court of Montgomery County" (emphasis added)).
I do not read § 27-13-32 as providing that a claim over a contractually agreed upon premium, such as the one at issue in the present case, is to be heard, in the first instance, exclusively by the commissioner. Accordingly, I do not believe the doctrine of exhaustion of administrative remedies applies in this case. Fraternal Order of Police, Strawberry Lodge # 40 v. Entrekin, 294 Ala. 201, 209-10, 314 So.2d 663, 671 (1975).
State Farm, in its appellate brief, also contends that the claim under review is barred by the "primary-jurisdiction" doctrine. In Entrekin, our Supreme Court explained the differing applications of the exhaustion-of-administrative-remedies and primary-jurisdiction doctrines:
"`The doctrine of primary jurisdiction, like the rule requiring exhaustion of administrative remedies, is concerned with promoting proper relationships between the courts and the administrative agencies charged with particular regulatory duties. "Exhaustion" applies where a claim is cognizable in the first instance by an *150 administrative agency alone; judicial interference is withheld until the administrative process has run its course. "Primary jurisdiction," on the other hand, applies where a claim is originally cognizable in the courts, and comes into play whenever enforcement of the claim requires the resolution of issues which, under a regulatory scheme, have been placed within the special competence of an administrative body; in such a case the judicial process is suspended pending referral of such issues to the administrative body for its views....'
". . . .
"One of the aims of the doctrine is to insure uniformity and consistency in dealing with matters entrusted to an administrative body. Another factor which must be considered is whether referral to an agency is preferable because of its specialized knowledge or expertise in dealing with the matter in controversy. Still another is whether initial review of the controversy by the administrative body will either assist a court in its adjudicatory function or perhaps alleviate entirely the need for resort to judicial relief. This latter factor indicates it is preferable to obtain the views of the administrative body concerning the statutes or rules with which it must work and how those statutes or rules should be applied to the controversy at hand.
"We hold today that when a court and an administrative agency have concurrent jurisdiction over a controversy, the court may decline judicial relief pending administrative review when the court finds that administrative review of the controversy will promote uniformity and consistency in the application of the pertinent statutes, rules and regulations; agency expertise is required[;] and initial agency review will materially assist the court upon later review."
Entrekin, 294 Ala. at 210-11, 314 So.2d at 671-72 (some emphasis added; citations omitted; quoting United States v. Western Pac. R.R. Co., 352 U.S. 59, 63-64, 77 S.Ct. 161, 1 L.Ed.2d 126 (1956)).
Based on my review of the record, it does not appear that State Farm's motions presented to the trial court the issue of "primary jurisdiction." A determination with regard to such an argument should first be made by the trial court. This court is not at liberty to affirm a judgment on the basis of affirmative defenses not asserted in the trial court. E.g., Ex parte State. ex rel. State. of Ohio, 718 So.2d 669, 670-71 (Ala.1998).
Accordingly, I must respectfully dissent.
