*100In May 2015, Martez Thomas was the passenger in an automobile owned by Lena Spano and operated by Desean Evans, the father of Spano's child. An automobile operated by Calvin Jones ran a stop sign and collided with Spano's automobile; Thomas was injured. Thomas's damages exceeded the limits of Jones's automobile-liability policy, so Thomas sued Spano's insurer, Safeway Insurance Company of Alabama, Inc. ("Safeway"), in the Jefferson Circuit Court ("the trial court") seeking underinsured-motorist ("UIM") benefits. Safeway filed a motion for a summary judgment, in which it argued that Thomas was not entitled to benefits under Spano's policy based on an exclusion in the policy precluding coverage when the automobile covered under the policy was being operated by an unlicensed driver ("the unlicensed-driver exclusion").
Thomas opposed Safeway's motion and also sought a judgment in his favor. After discovery was completed, the parties stipulated to the following facts: Evans was not and had not ever been a licensed driver, and Thomas was unaware that Evans did not possess a driver's license; no other facts regarding the accident were disputed. Based on arguments made by Thomas, the trial court entered a judgment declaring the unlicensed-driver exclusion unenforceable against Thomas because, the trial court said, based on Thomas's lack of knowledge of Evans's status as an unlicensed driver, the exclusion violated Alabama's UIM statute, Ala. Code 1975, § 32-7-23(a), and Alabama's public policy. The trial court further ordered Safeway to pay to Thomas the policy limits of $50,000 and costs of $173.10. Safeway timely appealed the judgment.
On appeal, Safeway argues that the trial court erred in declaring that the unlicensed-driver exclusion in Safeway's policy violates § 32-7-23(a) or public policy. Safeway contends that the unlicensed-driver exclusion, like many other insurance-policy exclusions examined by Alabama courts, is enforceable and that, in essence, by basing its decision, in part, on Thomas's knowledge of Evans's status, the trial court impermissibly engrafted a knowledge requirement onto the exclusion and rewrote the policy. Based on our review of the relevant statutes and caselaw, we agree with Safeway that the unlicensed-driver exclusion is valid and enforceable.
General Principles Governing the Construction of Insurance Policies
We begin our analysis by setting out the general rules governing our construction of insurance contracts.
"General rules of contract law govern an insurance contract. Twin City Fire Ins. Co. v. Alfa Mut. Ins. Co., 817 So.2d 687, 691 (Ala. 2001). The court must enforce the insurance policy as written if the terms are unambiguous, id.; Liggans R.V. Ctr. v. John Deere Ins. Co., 575 So.2d 567, 569 (Ala. 1991). Whether a provision of an insurance policy is ambiguous is a question of law. Turvin v. Alfa Mut. Gen. Ins. Co., 774 So.2d 597, 599 (Ala. Civ. App. 2000)."
Safeway Ins. Co. of Alabama, Inc. v. Herrera, 912 So.2d 1140, 1143 (Ala. 2005). Furthermore, "[t]he identity of the insured and liability of the insurer are determined from the terms of the [insurance] contract." Kinnon v. Universal Underwriters Ins. Co., 418 So.2d 887, 888 (Ala. 1982).
In addition, the law gives guidance regarding the construction of exclusions within an insurance policy.
*101"[E]xceptions to coverage must be interpreted as narrowly as possible in order to provide maximum coverage to the insured. However, courts are not at liberty to rewrite policies to provide coverage not intended by the parties. Newman v. St. Paul Fire & Marine Insurance Co., 456 So.2d 40, 41 (Ala. 1984). In the absence of statutory provisions to the contrary, insurance companies have the right to limit their liability and write policies with narrow coverage. United States Fidelity & Guaranty Co. v. Bonitz Insulation Co. of Alabama, 424 So.2d 569, 573 (Ala. 1982). If there is no ambiguity, courts must enforce insurance contracts as written and cannot defeat express provisions in a policy, including exclusions from coverage, by making a new contract for the parties. Turner v. United States Fidelity & Guaranty Co., 440 So.2d 1026, 1028 (Ala. 1983)."
Johnson v. Allstate Ins. Co., 505 So.2d 362, 365 (Ala. 1987) ; see also Nationwide Mut. Ins. Co. v. Thomas, 103 So.3d 795, 803 (Ala. 2012).
Finally, because this case involves UIM coverage, we must look to the UIM statute for guidance. Alabama's UIM statute reads as follows:
"(a) No automobile liability or motor vehicle liability policy insuring against loss resulting from liability imposed by law for bodily injury or death suffered by any person arising out of the ownership, maintenance, or use of a motor vehicle shall be delivered or issued for delivery in this state with respect to any motor vehicle registered or principally garaged in this state unless coverage is provided therein or supplemental thereto, in limits for bodily injury or death set forth in subsection (c) of Section 32-7-6, under provisions approved by the Commissioner of Insurance for the protection of persons insured thereunder who are legally entitled to recover damages from owners or operators of uninsured motor vehicles because of bodily injury, sickness or disease, including death, resulting therefrom; provided, that the named insured shall have the right to reject such coverage; and provided further, that unless the named insured requests such coverage in writing, such coverage need not be provided in or supplemental to a renewal policy where the named insured had rejected the coverage in connection with the policy previously issued to him or her by the same insurer."
Ala. Code 1975, § 32-7-23(a).
We must also be cognizant of the following principles particularly applicable to UIM coverage.
"It was also held in [ State Farm Automobile Insurance Co. v.] Reaves [, 292 Ala. 218, 292 So.2d 95 (1974),] that Alabama's Uninsured Motorist Statute, Tit. 36, § 74(62a), Code 1940 (now § 32-7-23, Code 1975 ), mandated uninsured motorist coverage for 'persons insured thereunder,' that is, persons insured under the liability provisions of the policy. Thus, a class of insureds named in the provisions of an automobile liability policy in Alabama are provided uninsured motorist coverage regardless of whether that class is specifically named in the policy providing uninsured motorist coverage.
"Therefore, the Court must look to the terms for which the parties contracted in order to ascertain the extent of coverage under uninsured motorist provisions."
Alabama Farm Bureau Mut. Cas. Ins. Co. v. Pigott, 393 So.2d 1379, 1382-83 (Ala. 1981). "[W]here an exclusion in a policy is more restrictive than the uninsured motorist statute, it is void and unenforceable."
*102Watts v. Preferred Risk Mut. Ins. Co., 423 So.2d 171, 175 (Ala. 1982) ; see also Alabama Farm Bureau Mut. Cas. Ins. Co. v. Mitchell, 373 So.2d 1129, 1134 (Ala. Civ. App. 1979) (stating that "insurance policy provisions that attempt to limit or infringe upon uninsured motorist coverage are contrary to the uninsured motorist statute and are thereby void and unenforceable").
Finally, we note that, when considering whether a contractual provision violates public policy, courts must proceed cautiously.
"[When considering] whether a contractual provision is in violation of public policy, our Supreme Court has repeatedly declared that '[t]he principle that contracts in contravention of public policy are not enforceable should be applied with caution and only in cases plainly within the reason on which the doctrine rests.' Lowery v. Zorn, 243 Ala. 285, 288, 9 So.2d 872, 874 (1942) ; see also, e.g., Livingston v. Tapscott, 585 So.2d 839 (Ala. 1991) ; Ex parte Rice, 258 Ala. 132, 61 So.2d 7 (1952). As our Supreme Court explained in Milton Construction Co. v. State Highway Department, 568 So.2d 784 (Ala. 1990),
" ' "The courts are averse to holding contracts unenforceable on the ground of public policy unless their illegality is clear and certain. Since the right of private contract is no small part of the liberty of the citizen, the usual and most important function of courts of justice is to maintain and enforce contracts rather than to enable parties thereto to escape from their obligations on the pretext of public policy, unless it clearly appears that they contravene public right or the public welfare....
" ' "...." ' "
" 568 So.2d at 788 (quoting 17 Am. Jur. 2d Contracts § 178 (1964) )."
Alfa Specialty Ins. Co. v. Jennings, 906 So.2d 195, 199-200 (Ala. Civ. App. 2005).
The Terms of the Insurance Policy
The Safeway policy issued to Spano contains the following provisions and definitions:
" 'Non-Covered Person' as used in this Policy means:
"....
"4. An operator of a vehicle who is an unlicensed driver or whose driving privileges have been terminated or suspended."
Under Part A, which governs liability coverage, the policy provides:
"We will pay damages for bodily injury or property damage for which a Covered Person, as defined in this part, becomes legally responsible because of an auto accident."
A "Covered Person" under Part A is defined as
"1. You for the ownership, maintenance or use of Your Covered Auto[1 ] or trailer, unless it is operated by a Non-Covered Person.
"2. A person, other than a Non-Covered Person, using Your Covered Auto with your express permission within the scope of that permission.
"3. For Your Covered Auto, any person or organization, other than a Non-Covered Person, but only with respect to legal responsibility for acts or omissions of an operator of Your Covered Auto, provided said operator is not a Non-Covered Person."
*103In Part C, the policy addresses UIM coverage. The policy provides:
"We will pay damages which a Covered Person, as defined in this Part, is legally entitled to recover from the owner or operator of an uninsured motor vehicle because of bodily injury:
"1. Sustained by a Covered Person; and
"2. Caused by an accident, which in no way involves the operation of any automobile by a Non-Covered Person;
"The owner's or operator's liability for these damages must arise out of the ownership, maintenance or use of the uninsured motor vehicle."
In Part C, "Covered Person" is defined as:
"1. You, and a Family Member other than a Non-Covered Person
"2. Any other person occupying Your Covered Auto (provided it is not operated by a Non-Covered Person)"
In Part C, the policy also contains the following exclusion:
"A. We do not provide Uninsured Motorist Coverage for bodily injury sustained by any person:
"1. During or as a result of operation of any automobile by a Non-Covered Person."
Standard of Review
We review a summary judgment de novo; we apply the same standard as was applied in the trial court. A motion for a summary judgment is to be granted when no genuine issue of material fact exists and the moving party is entitled to a judgment as a matter of law. Rule 56(c)(3), Ala. R. Civ. P. As noted above, the parties stipulated to the facts in this case; thus, the only issue before the trial court, and this court on appellate review, is whether Thomas was entitled to a judgment as a matter of law. See Nationwide Ins. Co. v. Rhodes, 870 So.2d 695, 697 (Ala. 2003).
Discussion
Safeway argues that Thomas is not entitled to UIM coverage because he was a passenger in Spano's automobile ("the covered auto") while it was being driven by Evans, who was not a licensed driver at the time of the accident. Based on the definitions and exclusions stated in the policy, Safeway contends, Thomas's right to any recovery as a passenger in the covered auto was extinguished by the fact that Evans was a noncovered person operating the covered auto. Thomas argues, however, that the unlicensed-driver exclusion violates § 32-7-23 and public policy, which, he says, is that innocent persons are entitled to coverage for damages resulting from an accident with an uninsured or underinsured motorist. The trial court agreed with Thomas that, because he was an innocent passenger, unaware that Evans was an unlicensed driver, he was entitled to coverage.
However, the UIM statute does not require coverage for all "innocent" persons who might be injured by an uninsured or underinsured motorist. Section 32-7-23(a) specifically prescribes that UIM insurance coverage be provided in every insurance policy for "the protection of persons insured thereunder." See Higgins v. Nationwide Mut. Ins. Co., 291 Ala. 462, 465, 282 So.2d 301, 303 (1973) ; State Farm Auto. Ins. Co. v. Reaves, 292 Ala. 218, 223, 292 So.2d 95, 99 (1974) ("[O]nce an automobile liability policy is issued extending coverage to a certain class of insureds under such a clause, uninsured motorist coverage must be offered to cover the same class of insureds."). Nothing in the UIM statute requires coverage for persons who are not insured under the applicable policy, and the determination of those persons to *104whom liability coverage is extended must be based on the language of the applicable policy. Pigott, 393 So.2d at 1382 ("[T]he mandated reciprocal extent of uninsured motorist coverage is determined by the extent of liability coverage for which the parties have contracted in the same policy."). Spano is the only named insured in her policy; neither Evans nor Thomas are listed on the policy. Spano's policy excludes liability coverage for any person, even her, when the covered auto is being driven by an unlicensed driver. Thus, under § 32-7-23(a), the policy is not required to include UIM coverage under these circumstances.
In addition, § 32-7-23(a) permits a person to reject UIM insurance in whole or in part. Several cases have discussed the rejection of UIM coverage. See Reed v. Farm Bureau Mut. Cas. Ins. Co., 549 So.2d 3, 6 (Ala. 1989) (explaining that the specific language of an exclusion from coverage of a named individual operated only to prevent coverage when that person was driving a covered vehicle); McCullough v. Standard Fire Ins. Co. of Alabama, 404 So.2d 637 (Ala. 1981) (concluding that the exclusion of a named person operated to extinguish a passenger's rights to UIM benefits under the policy when the excluded person was the driver of the covered vehicle); and Safeway Ins. Co. of Alabama, Inc. v. Hambrick, 723 So.2d 93 (Ala. Civ. App. 1998) (concluding that the failure to list a member of the household under age 25 on the insurance application was a rejection of both liability and UIM coverage as to that driver based on the exclusion for unlisted drivers under age 25 living in the insured's household). We find McCullough and Hambrick particularly instructive.
In McCullough, our supreme court considered whether an exclusion that excluded the insurer from liability when the insured's son, Robert, was driving any covered automobile was enforceable to prevent the estate of the passenger killed in the vehicle operated by Robert from recovering UIM benefits or whether the exclusion was void as against public policy. Our supreme court indicated that the appellant, the estate of the deceased passenger, had argued that the issue was " 'whether or not, the restrictive endorsement contained in the liability insurance policy issued herein, was effective to cut off any uninsured motorist coverage running to the benefit of [the deceased passenger].' " McCullough, 404 So.2d at 638. The trial court had declined to find that the deceased passenger was entitled to UIM coverage, stating: " 'This Court knows of no law that gives ... a stranger to a policy of insurance the right to presume that the car in which he rides is covered by the provisions of an uninsured motorist policy.' " Id. Instead, the UIM statute is for the benefit of " 'Alabama citizens purchasing automobile liability insurance' " so that they may " 'be able to obtain for an additional premium the same protection against injury or death at the hands of an uninsured motorist as they would have had if that motorist had obtained for himself the minimum liability coverage required by the Safety Responsibility Act.' " Id. at 638-39 (quoting Higgins v. Nationwide Mut. Ins. Co., 50 Ala. App. 691, 695-96, 282 So.2d 295, 300 (Civ. 1973), aff'd, 291 Ala. 462, 282 So.2d 301 (Ala. 1973) ). Relying in part on the rationale expressed in Southeast Title & Insurance Co. v. Thompson, 231 So.2d 201 (Fla. 1970), our supreme court reasoned that, because the UIM statute allowed an insured to reject UIM coverage, "the failure to carry the coverage does not violate the public policy of this State." Id. at 639. The insured had partially rejected both liability and UIM insurance as to Robert, the court said, and it concluded that the insurer was not required *105to provide UIM benefits to the estate of the deceased passenger. Id.
Similarly, this court rejected the argument that an injured passenger was entitled to UIM coverage under an insurance policy that excluded coverage for unlisted drivers under 25 years old who resided in the household of the insured. Hambrick, 723 So.2d at 97. When the insured, Patsy White, secured her policy in 1995, she failed to list her son, Travis Lightfoot, as a resident of her household over the age of 14, as required by the application. Id. at 93. In 1997, Lightfoot, who was under 25 years old and a resident of White's household, was driving the covered vehicle when he was involved in an accident with an uninsured motorist. Id. at 94. Kenyon Hambrick, a passenger in the covered vehicle, suffered injuries in the accident. Id. Hambrick sought UIM benefits under White's policy, and Safeway sued, seeking a judgment declaring that it was not required to pay UIM benefits to Hambrick. Id. The trial court determined that Hambrick was entitled to UIM benefits under the policy, and Safeway sought appellate review of that decision. Id. at 95.
Relying on McCullough, we determined that UIM benefits were not due Hambrick under White's policy. Id. at 97. Because UIM coverage (as opposed to the offering of such coverage) is not mandatory, we explained, White's failure to list Lightfoot in her policy application effectively served as a rejection of UIM coverage as to him, and the exclusion in White's policy was enforceable. Id. We noted that Hambrick had paid nothing for the coverage he sought, underscoring the idea in McCullough and Higgins that UIM coverage is for the protection of those who purchase liability insurance and not necessarily everyone who might be injured by an uninsured or underinsured motorist. Id. at 96.
We realize that Thomas has attempted to distinguish cases like Hambrick and McCullough on the ground that those cases involve a rejection of coverage for "specific" individuals. Of course, in Hambrick, it was the failure to list a specific person, Lightfoot, on the insurance application that resulted in the determination that the insured, White, had rejected any coverage for him. Id. at 96-97. The provision upon which that rejection was based in Hambrick, however, was what Thomas refers to as a "blanket" exclusion, excluding coverage for a class of individuals: those under age 25, residing in the household of the insured, who had not been listed on the policy application. Id. The exclusion in the present case is also a "blanket" exclusion, excluding coverage for individuals operating a vehicle who do not have a driver's license. Because Spano agreed that her policy would not cover her automobile if its was driven by an unlicensed driver, she, like White, "partially rejected" UIM coverage in such situations, which she was entitled to do under § 32-7-23(a). See id. at 97.
We also reject Thomas's argument that the unlicensed-driver exclusion is void as against public policy because of a statement contained in Grimes v. Alfa Mutual Insurance Co., 227 So.3d 475, 488 (Ala. 2017). In a discussion of mandatory liability coverage, our supreme court stated that "[a] person who does not own the automobile that he or she operates must purchase an operator's policy or a non-owner policy in order to qualify for a driver's license." Grimes, 227 So.3d at 488. According to Thomas, this "fact" means that an unlicensed driver cannot get a driver's license or insurance, leaving that person with no ability to comply with the law regarding licensing or compulsory liability insurance. The Grimes court cited no statute or caselaw, and we can find none, to support the above-quoted statement, which does not appear to be necessary to the holding in the opinion. Thus, we conclude that the *106statement is dicta and that Thomas's argument that Evans would be unable to secure a driver's license or insurance is unavailing.
Based on the principles espoused by both our court and our supreme court, we conclude that the trial court erred in declaring that the exclusion in Safeway's policy violated § 32-7-23(a) and public policy.2 The exclusion is valid under the rationale announced in McCullough and applied in Hambrick.3 The trial court's judgment in favor of Thomas is therefore reversed, and the cause is remanded to the trial court for the entry of a judgment consistent with this opinion.
REVERSED AND REMANDED.
Thompson, P.J., and Pittman and Donaldson, JJ., concur.
Moore, J., concurs in the result, without writing.
The parties appear to agree that the automobile in which Thomas was a passenger was a "covered auto" under the terms of Spano's policy.
In his appellate brief, Thomas asserts for the first time an argument that Safeway should be estopped from relying on the unlicensed-driver exclusion because it consented to his settlement with Jones for Jones's policy limits. "We decline to consider the question of estoppel, raised for the first time on appeal." Warrior Drilling and Eng'g Co. v. King, 446 So.2d 31, 32 (Ala. 1984).
Because we have concluded that the exclusion is valid, we need not address Safeway's contention that the trial court rewrote the exclusion by engrafting a knowledge requirement. We note, however, that a court may not rewrite the unambiguous terms of an insurance contract. Johnson, 505 So.2d at 365.