
289 F.Supp.2d 614 (2003)
Robert M. CURLEY
v.
ALLSTATE INSURANCE COMPANY
No. CIV.A.03-4814.
United States District Court, E.D. Pennsylvania.
October 31, 2003.
*615 Harold I. Goodman, Raynes McCarty Binder Ross & Mundy, Philadelphia, PA, for Plaintiff.
Daniel V. Johns, Ballard Spahr Andrews & Ingersoll LLP, Philadelphia, PA, for Defendant.

MEMORANDUM
DALZELL, District Judge.
In August of 2000, defendant Allstate Insurance Company entered into an Independent Exclusive Agency Agreement with plaintiff Robert M. Curley, a fifteen-year employee who had recently established his own insurance agency. When Curley's Pennsylvania insurance license temporarily lapsed in 2001, his Agreement with Allstate automatically terminated. Allstate then occasioned this suit by refusing to reinstate Curley, thereby compelling him to sell his book of business to another agent.[1]
In the Rule 12(b)(6) motion[2] now before us, Allstate seeks dismissal of Curley's *616 claims for unjust enrichment and breach of the covenant of good faith and fair dealing. We write at some length about this factually simple case because it casts into relief two often-confusing issues in the law of contracts: the circumstances under which an express contractual term overrides the covenant of good faith and fair dealing, and the `principle that a claim for unjust enrichment is unavailable where the parties' relationship is founded on a contract.

I. Factual Background

According to the complaint, Curley began to work in Allstate's underwriting department in 1985, and in April of 1993, he obtained a Pennsylvania insurance license. In February of 1999, Curley entered into an R3000 Exclusive Agent Employment Agreement with Allstate, under which he became an Allstate agent but remained a company employee. After Curley completed eighteen months as an Exclusive Agent, he and Allstate signed an R3001 Independent Exclusive Agency Agreement in August of 2000. As an Independent Exclusive Agent, Curley worked as an independent contractor and sold insurance products for Allstate on a commission basis.
In mid-July of 2001, Allstate notified Curley that his Pennsylvania insurance license had lapsed. Upon further investigation, Curley learned that, as a result of a recent change in the Department of Insurance's rules, his license had expired in April (the month his license had originally issued) rather than September (his birth month).[3] On Thursday, July 19, 2001, Curley went to Allstate's regional headquarters, where a company representative sponsored Curley's renewal application by signing the necessary Department of Insurance paperwork. Curley then drove to Harrisburg on Friday and hand-delivered his application. The Department of Insurance reissued Curley's license on Monday.
Two days later, Allstate invoked the termination provisions in the R3001 Agreement and refused to reinstate Curley as an agent. Under the terms of the Agreement, Curley had no choice but to sell his book of business to another agent, subject to Allstate's approval. He ultimately sold to Gerald Cassidy, a more senior Allstate agent who no longer received the "significantly greater" commissions that Allstate pays newlyestablished independent agents such as Curley. Compl. ¶ 48.

II. Discussion

Curley's complaint asserts four claims. Count I avers that Allstate breached the covenant of good faith and fair dealing by invoking the termination provisions of the Agreement. Count II advances a claim under the covenant of good faith focusing on Allstate's refusal to reinstate Curley after he renewed his insurance license. Count III asserts that Curley's sale of his book of business unjustly enriched Allstate because it pays Cassidy a lower commission *617 than Curley had received. Count IV raises a claim for tortious interference with prospective contractual relations that stems from Allstate's alleged statements to a prospective employer after Curley's termination. Allstate has not challenged Count IV, but seeks dismissal of the rest of the complaint.

A. Breach of the Covenant of Good Faith and Fair Dealing (Counts I and II)

The Pennsylvania Superior Court[4] has adopted Section 205 of the Restatement (Second) of Contracts ("Section 205"), which provides that "[e]very contract imposes upon each party a duty of good faith and fair dealing in its performance and its enforcement." See Kaplan v. Cablevision of Pa., Inc., 448 Pa.Super. 306, 671 A.2d 716, 721 (1996) (citing Creeger Brick & Bldg. Supply, Inc. v. Mid-State Bank & Trust Co., 385 Pa.Super. 30, 560 A.2d 151, 153 (1989) and Baker v. Lafayette Coll., 350 Pa.Super. 68, 504 A.2d 247, 255 (1986)). The function of the covenant is to prohibit a party from "taking advantage of gaps in a contract in order to exploit the vulnerabilities that arise when contractual performance is sequential rather than simultaneous." Original Great Am. Chocolate Chip Cookie Co., Inc. v. River Valley Cookies, Ltd., 970 F.2d 273, 280 (7th Cir. 1992). Although the precise contours of a party's duty under the covenant vary with the context, good faith generally entails "faithfulness to an agreed common purpose and consistency with the justified expectations of the other party." Section 205 cmt. a.
In their efforts to temper the lofty language of the Restatement, courts have emphasized that the covenant of good faith is nothing more than an implied contractual term that does not override the express terms of the parties' bargain or transform them into each other's fiduciaries. See Original Great Am. Chocolate Chip Cookie Co., 970 F.2d at 280; see also Kham & Nate's Shoes No. 2 v. First Bank, 908 F.2d 1351, 1357 (7th Cir.1990) ("`Good faith' is a compact reference to an implied undertaking not to take opportunistic advantage in a way that could not have been contemplated at the time of drafting, and which therefore was not resolved explicitly by the parties.").
However, courts in Pennsylvania and elsewhere have not hesitated to recognize that, where applicable, the covenant can significantly limit the parties' ability to engage in self-dealing conduct. One such context is where the contract grants one party discretion over some aspect of performance, for in these cases the party accorded discretionary power can opportunistically subvert the legitimate expectations of the other party. See, e.g., Huang v. BP Amoco Corp., 271 F.3d 560, 564-65 (3d Cir.2001); Goldstein v. Johnson & Johnson, 251 F.3d 433, 444 (3d Cir.2001); Baker, 504 A.2d at 255.
With these principles in mind, we scrutinize the terms of the Agreement to determine whether Curley has stated claims under the covenant of good faith and fair dealing.[5] The Agreement expressly provides *618 that it will be "terminated automatically ... upon the loss of any required agent license." Agreement § XVII.A.4. Although this language suggests that the lapse of Curley's license ended his relationship with Allstate, other provisions of the Agreement reveal that "automatic termination" is more analogous to a marital separation than a full-blown divorce. The Agreement incorporates Allstate's Exclusive Agent Manual ("EA Manual"), which describes in some detail the reinstatement procedures that take effect when an agent's license lapses:
The R3001 Agreement automatically terminates upon the loss of any required agent license. Therefore, when the Company is notified that this has occurred, you will be notified that your Agreement has terminated.
If you still want to maintain an agency relationship with the Company, and you meet the necessary state requirements ... to reinstate your license within thirty (30) days of notice of the license termination, at the Company's discretion, you may execute a new R3001S (or C) Agreement when the license is reinstated. You will keep your same agent number. In the meantime (i.e. upon termination of the agreement and prior to reinstatement of the license):
 You will cease any activities that require an agent license ....
 You may continue to perform those activities that do not require an agent license ....
It is important to note, however, that if you fail to meet the licensing requirements within thirty (30) days, the termination processing will continue and at that point, you should refer to Sale of Agency and Termination Payment for information about the sale of agency and termination payment options that may be available.
Compl. Ex. A (reproducing portions of EA Manual).
In sum, the Agreement automatically terminated Curley's agency relationship with Allstate. However, it did not completely unwind their contractual relationship and thereby reduce Curley to the status of a stranger, whose offer to become an agent Allstate could, at its whim, accept, reject, or ignore altogether.[6] As long as Curley renewed his state license within thirty days, he could request reinstatement and, by necessary implication, insist on a response from Allstate.
In view of this contractual framework, we must dismiss Count I of the complaint, which asserts that Allstate breached the covenant of good faith and fair dealing by terminating its agency relationship with Curley. The Agreement states that termination occurs automatically upon the lapse of Curley's license, and as we note above, the covenant of good faith does not override the express terms of the contract.[7] Indeed, it is difficult to *619 see how the covenant of good faith has any bearing at all on a contractual term that strips both parties of discretion.
Count II of the complaint, which focuses on Allstate's alleged bad faith in refusing to reinstate Curley, demands a different analysis. Allstate offers two arguments in favor of the dismissal of Count II. First, it contends that this claim fails as a matter of law because, as a result of the automatic termination provision, there was no contract in existence when it declined to enter a new agency agreement with Curley. As we explain above, however, the EA Manual sets forth a reinstatement process that belies Allstate's claim that the lapse of Curley's license sundered the parties' contractual relationship.
In the alternative, Allstate argues that even if there was a contract in existence, the express language of the EA Manual overrides the covenant of good faith because it granted Allstate "the unfettered right to decline plaintiff's request for reinstatement." Def.'s Mem. at 6. We decline to accept Allstate's expansive construction of the parties' agreement at such an early juncture in this case. The EA Manual merely provides that reinstatement is "at the Company's discretion." We cannot say that this language unequivocally preserved Allstate's right to seize upon the lapse of an agent's license to dump him for any reason, good or bad. Not only must we construe the Agreement and EA Manual contra proferentem, see supra n. 5, but even a casual examination of Pennsylvania authority shows that whether the covenant of good faith governs a party's conduct is a fact-intensive inquiry that can yield divergent results in contextually similar cases. Compare Baker, 504 A.2d at 255-56 with Linson v. Trustees of the Univ. of Pa., No. 95-3681, 1996 WL 479532, at *10 (E.D.Pa. Aug. 21, 1996) (R. Kelly, J.). In the absence of wholly explicit and unambiguous contractual language such as we encountered in the Agreement's automatic termination provisions, it would be inappropriate for us to dismiss Count II on a Rule 12(b)(6) motion.

B. Unjust Enrichment (Count III)

In Count III, Curley invokes the doctrine of unjust enrichment to disgorge the extra profits that Allstate now reaps from his former book of business as a result of the lower commissions it pays the new agent. Unjust enrichment occurs when (1) the plaintiff has conferred benefits on the defendant, (2) the benefits have appreciated, and (3) it would be inequitable for the defendant to retain those benefits without payment of value. Styer v. Hugo, 422 Pa.Super. 262, 619 A.2d 347, 350 (1993). Where there has been unjust enrichment, the courts will imply a quasi contract  which the Pennsylvania Commonwealth Court has defined as "not really a contract at all, but a fictional contract which is a form of the remedy of restitution"  and require the defendant to pay the plaintiff the value of the benefit conferred. Crawford's Auto Center v. State Police, 655 A.2d 1064, 1070 (Pa.Cmwlth. 1995).
Curley argues that he has stated a claim for unjust enrichment because he does not have a contractual remedy that can redress Allstate's allegedly wrongful conduct. However, Pennsylvania law has long recognized that the doctrine of unjust enrichment is unavailable where, as here, "the relationship between parties is founded on a written agreement or express contract." *620 Schott v. Westinghouse Elec. Corp., 436 Pa. 279, 259 A.2d 443, 448 (1969); Third Nat'l Bank & Trust Co. of Scranton v. Lehigh Valley Coal Co., 353 Pa. 185, 44 A.2d 571, 574 (1945). Although the Pennsylvania Supreme Court has not visited this issue since 1969, we are Erie-bound by its square holding in Schott and must therefore dismiss Count III.
We digress to point out that, even if we could ignore Schott, we very much doubt that the Pennsylvania Supreme Court would abandon the rule that contractual parties cannot invoke the doctrine of unjust enrichment when their relationship unravels. Not only does the rule have a distinguished common-law pedigree, but it also derives a great deal of justification from bedrock principles of contract law.
We begin with history. The doctrine of unjust enrichment dates back to Moses v. Macferlan, 97 Eng. Rep. 676 (K.B.1760). One Jacob had made out four promissory notes payable to plaintiff Moses. To enable defendant Macferlan to collect the £6 debt, Moses endorsed the notes to Macferlan. Moses and Macferlan also signed an indemnity agreement so "that Moses should not be liable to the payment of the money or any part of it ... by reason of such his endorsement." Id. at 676, 259 A.2d 443. Macferlan then sued Moses on the endorsement in the Court of Conscience, and he prevailed after the court refused to consider the indemnity agreement. Moses paid the judgment and then brought an action in assumpsit in the Court of Kings Bench. He prevailed in a jury trial, and Lord Mansfield affirmed the verdict, holding that in a case of unjust enrichment the law would allow the plaintiff to proceed in assumpsit by implying the existence of a contract:
If the defendant be under an obligation, from the ties of natural justice, to refund; the law implies a debt, and gives this action, founded in the equity of the plaintiff's case, as it were upon a contract ("quasi ex contractu," as the Roman law expresses it).
Id. at 678, 259 A.2d 443.
British courts were slow to embrace Lord Mansfield's approach. Indeed, as late as 1923 Lord Justice Scrutton dismissed a quasi contractual theory of liability with the peevish remark that "[w]hatever may have been the case 146 years ago, we are not now free in the twentieth century to administer that vague jurisprudence which is sometimes attractively styled `justice as between man and man' ...." Holt v. Markham, [1923] 1 K.B. 504, 513 (1923). Although the doctrine found a more receptive audience among American jurists, they confirmed that it is a remedy designed to protect the plaintiff whose injury does not arise from a contractual relationship with the unjustly enriched defendant. In 1857, the Pennsylvania Supreme Court underscored this point in a discussion of the differences between the quasi contract and the implied-in-fact contract:
In one case the contract is mere fiction, a form imposed in order to adapt the case to a given remedy; in the other it is a fact legitimately inferred. In one, the intention is disregarded; in the other, it is ascertained and enforced. In one, the duty defines the contract; in the other, the contract defines the duty.
Hertzog v. Hertzog, 29 Pa. 465, 465 (1857); see also Cameron, to Use of Cameron v. Eynon, 332 Pa. 529, 3 A.2d 423, 424 (1939) ("A quasi contract arises where the law imposes a duty upon a person, not because of any express or implied promise on his part to perform it, but even in spite of any intention he might have to the contrary.").
Pennsylvania's bright-line rule also has deep roots in the classical liberal theory of contract. It embodies the principle that parties in contractual privity, such as Curley and Allstate, are not entitled to the *621 remedies available under a judicially-imposed quasi contract because the terms of their agreement (express and implied) define their respective rights, duties, and expectations. When the non-breaching party elects to sue on the contract, ordinary contract rules limit compensatory damages to his expectancy interest, even if this measure of relief fails to disgorge the breacher's profits. See generally E. Allan Farnsworth, Your Loss or My Gain? The Dilemma of the Disgorgement Principle in Breach of Contract, 94 Yale L.J. 1339 (1985); see also Dan Dobbs, 3 Law of Remedies § 12.7(4), at 174-78 (2nd ed.1993) (outlining exceptions to the general rule, the most significant of which being where the breach of contract also involves a breach of fiduciary duty).

III. Conclusion

We therefore will grant Allstate's motion as to Counts I and III, but allow the case to proceed on Counts II and IV. An Order to this effect follows.

ORDER
AND NOW, this 31st day of October, 2003, upon consideration of defendant's motion to dismiss (docket entry # 2), plaintiff's response thereto, and defendant's reply memorandum, and in accordance with the accompanying Memorandum, it is hereby ORDERED that:
1. The motion is GRANTED IN PART AND DENIED IN PART;
2. Counts I and III of the complaint are DISMISSED;
3. In all other respects, the motion is DENIED;
4. Defendant shall ANSWER the complaint by November 21, 2003; and
5. A Rule 16 conference shall CONVENE in Chambers (Room 10613) at 2:00 p.m. on Tuesday, December 2, 2003.
NOTES
[1]  Curley filed this action in the Philadelphia Court of Common Pleas on July 22, 2003. Allstate removed it to federal court on August 21, 2003 on the basis of diversity of citizenship.
[2]  In resolving a motion to dismiss brought under Fed.R.Civ.P. 12(b)(6), we look only to the facts alleged in the complaint and its attachments. Jordan v. Fox, Rothschild, O'Brien & Frankel, 20 F.3d 1250, 1261 (3d Cir.1994). We accept as true all factual allegations in the complaint, and draw all reasonable inferences therefrom in the light most favorable to the non-movant. General Motors Corp. v. New A.C. Chevrolet, Inc., 263 F.3d 296, 325 (3d Cir.2001). Although we need not accept as true "unsupported conclusions and unwarranted inferences," we must deem the complaint to have alleged sufficient facts if it adequately provides the defendants with notice of the essential elements of the plaintiff's claims. Langford v. City of Atlantic City, 235 F.3d 845, 847 (3d Cir.2000); Schuylkill Energy Res., Inc. v. Pennsylvania Power & Light Co., 113 F.3d 405, 417 (3d Cir.1997). We may dismiss a complaint "only if it is clear that no relief could be granted under any set of facts that could be proved consistent with the allegations." Hishon v. King & Spalding, 467 U.S. 69, 73, 104 S.Ct. 2229, 81 L.Ed.2d 59 (1984).
[3]  According to the complaint, Curley had recently moved to a new residence. He apparently never provided the Department of Insurance with his new address, and the United States Postal Service did not forward the license renewal notice.
[4]  The Agreement does not contain a choice of law provision, but both parties' pleadings rely exclusively on Pennsylvania authority, and we see no reason to quibble with that reliance. We are also well aware of the fact that the Pennsylvania Superior Court does not enunciate the definitive word on Pennsylvania law, but as its jurisprudence here is Restatement-based, we harbor confidence that the Pennsylvania Supreme Court would not take exception to our use of these decisions in making our Erie predictions here.
[5]  We note that Curley had no hand in drafting either the Agreement, and we therefore construe it contra proferentem. See Sun Co., Inc. (R & M) v. Pennsylvania Turnpike Comm'n, 708 A.2d 875, 878-79 (Pa.Cmwlth.1998) ("Under the rule of contra proferentem, any ambiguous language in a contract is construed against the drafter and in favor of the other party if the latter's interpretation is reasonable.").
[6]  The distinction between the parties' agency relationship and their contractual relationship is not mere wordplay. As the EA Manual notes, the Commonwealth can subject Allstate to regulatory action and penalties if an agent continues to sell insurance after his license has lapsed. See Compl. Ex. A. Automatic termination of the agency relationship thus protects Allstate from its agents' failure to comply with state law. However, it does not follow from the fact that the R3001 contains this protective provision that the parties' entire contractual relationship also ends when the agent's license lapses.
[7]  Curley argues that termination could not be automatic because Allstate chose to sponsor his license renewal. Pl.'s Resp. at 13. However, Allstate's conduct was consistent with the above-described contractual framework, which certainly contemplated the possibility of reinstatement but deferred that decision until the Department of Insurance had acted on the renewal application. Curley also argues that termination cannot be automatic because Allstate has declined to terminate other, similarly-situated agents. Id. If those agents also signed R3001 Agreements, it would be more accurate to say that Allstate chose to reinstate them following their automatic termination.
