
561 P.2d 687 (1977)
FILLMORE PRODUCTS, INC., a Utah Corporation, Plaintiff and Appellant,
v.
WESTERN STATES PAVING, INC., a Utah Corporation, and United States Fidelity and Guaranty Company, Defendants and Respondents.
No. 14500.
Supreme Court of Utah.
March 7, 1977.
*688 Dexter L. Anderson, Fillmore, for plaintiff and appellant.
Phillip L. Foremaster, St. George, for defendants and respondents.
WILKINS, Justice:
The plaintiff seeks reversal of a summary judgment granted in favor of the defendant, Western States Paving, Inc., a general contractor, on construction contracts entered into between the parties for the construction of a sewer system for the Town of Ferron, Utah. The complaint alleged in three causes of action that (1) the defendant failed to pay the plaintiff $34,738.39 for materials furnished and work and labor performed under the contracts, (2) that plaintiff incurred special damages in the sum of $35,000.00, and (3) that said defendant failed to pay $5,495.00 for equipment rental not related to the two construction contracts. The complaint also alleged that the other defendant, United States Fidelity and Guaranty Co., which guaranteed payment for work and materials, was liable on the payment bond in the sum of $34,738.39. Defendants answered and defendant Western counterclaimed alleging breach of contract and damages totaling $90,086.55.
The defendant filed a motion for summary judgment asking the court to dismiss the complaint for the reason that the plaintiff did not allege in its complaint that it was a licensed contractor in Utah and also because plaintiff in fact was not a licensed contractor and therefore could not enforce the contracts against the defendants. The District Court granted the motion with respect to the first two causes of action and plaintiff appeals therefrom.
It is undisputed from an affidavit filed by plaintiff's president in opposition to defendants' motion for a summary judgment that the plaintiff was not organized to engage in the business of construction work nor was it plaintiff's intention to ever engage in the construction business at any time subsequent to its entering into the single transaction with the defendant Western on the Ferron Town Sewer System *689 Project. Plaintiff is a Utah corporation organized to engage in the business of buying and selling lumber and alfalfa hay products, quarrying and selling lava rock products and operating a patio paver and landscaping products manufacturing plant. At no time has the plaintiff held itself out to the public as a licensed contractor under the Utah Contractors' Licensing Statute[1] to engage in the business of construction work.
Defendants argue that to allow enforcement of these contracts by plaintiff would be contrary to the policy of the law to protect the public from unlicensed contractors entering into construction contracts and performing construction work when they do not possess the necessary expertise and competence to do so.
Licenses are required basically for one of two purposes: to protect the public against fraud, incompetence, illegality, or irresponsibility; or to solely or primarily raise revenue.
If the purpose of licensing is to protect the public, then the general rule in this State is that the party who does not obtain a license, but is required to do so, cannot obtain relief to enforce the terms of his contract  including payment thereunder  even though there are other penalties imposed against him expressly by statute including criminal sanctions. This general rule is announced and discussed, inter alia, in two Utah cases.[2] And there is no doubt that the purpose of the licensing statute relating to contractors, supra, is protection of the public.[3]
But this court has recognized the harshness of declaring contracts of non-licensees void or unenforceable. In Mosley v. Johnson, supra, though payment to the unlicensed well driller was denied, Mr. Justice Ellett in writing for the majority opinion stated that the penalty prohibiting an unlicensed person "from recovering in the courts is severe enough" (emphasis added). And Mr. Justice Crockett, in his dissent, though he does not quarrel with the decision in Olsen v. Reese, supra, on its facts, emphasizes that under the circumstances of Mosley v. Johnson "it is inequitable and unjust to rule as a matter of law on summary judgment that the defendant can take the benefit of the plaintiff's labor and refuse to pay for it."
This court has not applied the general rule of denying relief to unlicensed persons mentioned above inflexibly or too broadly.[4] Nor do we now. Corbin[5] has stated:
Where it is clear that the statute requires the license ... the courts usually ... hold that bargains made in breach of the law are not enforceable by the wrongdoer. This accords with sound policy except when it operates with disproportionate severity... . In general, the nonenforceability of (such) bargains will have a salutary effect in causing obedience to the licensing statute. Therefore, the general rule will no doubt continue to be maintained as the "general" rule, while still permitting the court to consider the merits of the particular case and to avoid unreasonable penalties and forfeitures.
Although many courts yearn for a mechanically applicable rule, they have not made one in the present instance. Justice requires that the penalty should fit the crime; and justice and sound policy do not always require the enforcement of licensing statutes by large forfeitures going not to the state but repudiating defendants.
*690 We distinguish this case from those cited in note 2. In this case it is clear that an unlicensed subcontractor is dealing with a licensed general or original contractor. And the defendants have not disputed that the entire sewer project was under the supervision of a licensed project engineer, that all of the work had to meet the specifications and requirements of the general contract and that all of the work had to be approved and accepted by the project engineer before any payment was made by the Town of Ferron.
The parties should be able to present their positions to the court because under the facts of this case  which are undisputed concerning whether the general rule supra ought to be applied  the law intended for protecting the public might become "an unwarranted shield for the avoidance of a just obligation."[6]
We hold that a licensed contractor by obtaining his license is, in the eyes of the law, held to expertise in the contracting business and is therefore informed of the necessity for licensing therein and the purpose behind licensing, viz., the protection of the public. The licensed contractor consequently cannot invoke application of the general rule of denying relief to an unlicensed contractor solely because of the latter's non-licensing when a contract for construction is struck between them.
Other matters raised on appeal are not mentioned herein as this decision makes their resolution unnecessary. Reversed and remanded for trial or other proceedings not inconsistent with this opinion.
ELLETT, C.J., and CROCKETT and MAUGHAN, JJ., concur.
HALL, J., does not participate herein.
NOTES
[1]  Chapter 23, Title 58, Utah Code Annotated (1953).
[2]  Olsen v. Reese, 114 Utah 411, 200 P.2d 733 (1948), and Mosley v. Johnson, 22 Utah 2d 348, 453 P.2d 149 (1969).
[3]  Id., Olsen v. Reese and Sec. 58-1-39, Utah Code Annotated (1953).
[4]  See Platt v. Locke, 11 Utah 2d 273, 358 P.2d 95 (1961), and Butterfield v. Cheney, 12 Utah 2d 347, 366 P.2d 607 (1961).
[5]  Corbin on Contracts, Vol. 6A, Sec. 1512.
[6]  Matchett v. Gould, 131 Cal. App.2d 821, 281 P.2d 524 (1955).
