
    Argued January 5,
    affirmed as modified June 19,
    petition for rehearing denied September 5, 1979
    NORTH PACIFIC LUMBER CO., Appellant/Cross-Respondent, v. OLIVER, Respondent/Cross-Appellant,
    
    (No. [ AXX XX XXXXX ], SC No. 25090)
    596 P2d 931
    
      Jack H. Dunn of Morrison, Dunn, Cohen, Miller & Carney, Portland, argued the cause and filed briefs for appellant/cross-respondent. Also arguing the cause was Robert L. Allen, Portland.
    John D. Ryan, Portland, argued the cause for respondent/cross-appellant. On the briefs was Henry A. Carey, Jr., Portland.
    Before Denecke, Chief Justice, and Holman, Howell, and Lent, Justices.
    HOLMAN, J.
   HOLMAN, J.

Plaintiff, North Pacific Lumber Co., is a wholesaler of lumber products. Plaintiff’s employees conduct almost all of its trading activities over the telephone from its principal office in Portland, Oregon. In February 1967 plaintiff hired defendant Oliver as a lumber trader in its hardwood division. As part of his employment contract, defendant agreed to refrain from competing with plaintiff for two years following termination of his employment. The contract contained an extensive description of the type of competition prohibited. It authorized plaintiff to sue for an injunction and damages if Oliver violated the agreement; it also contained a clause authorizing recovery of attorney fees if plaintiff successfully maintained a suit or action to enforce the covenant. In 1969 plaintiff promoted defendant to the position of assistant manager in its hardwood division. In April 1976 defendant voluntarily terminated his employment. Soon thereafter he went to work for Tree Products Company. Tree Products competes with plaintiff, under the terms of the contract.

In May 1976 plaintiff filed suit in circuit court, naming Oliver and Tree Products as defendants. Plaintiff failed to serve Tree Products so it never became an actual party to the litigation. Plaintiff sought a decree enjoining defendants from engaging in employment in violation of Oliver’s employment contract, using plaintiff’s confidential business information, and soliciting plaintiff’s customers and suppliers. Plaintiff requested judgment for damages in an amount to be ascertained by the court at trial, costs and disbursements including a reasonable sum for attorney fees, and such other relief as the court deemed just and equitable. Once Oliver learned of plaintiff’s suit, he stopped actively soliciting sales for Tree Products. In his responsive pleadings, Oliver challenged the validity of the covenant, contending it was unreasonable. As a defense to its enforcement, defendant asserted that plaintiff had "unclean hands.” Defendant counterclaimed for attorney fees, costs and disbursements, and such other relief as the court deemed equitable.

After a lengthy trial, the court found the employment contract was valid but refused to enforce the covenant because of plaintiff’s unclean hands. The court dismissed plaintiff’s complaint with prejudice. The court rejected defendant’s argument at trial that the contract was oppressive and refused to award him wages on a theory on quantum meruit. Since the employment contract permitted plaintiff to recover attorney fees in a suit to enforce the covenant, the court awarded defendant attorney fees pursuant to ORS 20.096 in the amount of $105,000. Plaintiff appeals the dismissal of its complaint and the award of attorney fees to defendant, while defendant cross appeals the size of the attorney fees award.

As a suit in equity, the case is before this court de novo. ORS 19.125(3). While the trial court’s findings are not binding on this court, they are persuasive. Carlson v. Pryor, 262 Or 131, 134, 497 P2d 202 (1972). At the outset, it is necessary to determine what issues remain for this court to consider on appeal. It is apparent from defendant’s contract that if plaintiff had prevailed below, the effective period of the injunction would have ended in April 1978, two years after termination. Since the appeal was not argued until January 5, 1979, the two-year period during which defendant agreed not to compete under the covenant had expired by its own terms and the suit for an injunction is moot. Professional Business Services v. Gustafson, 285 Or 307, 590 P2d 729 (1979). However, the trial court also denied plaintiff’s claim for damages and attorney fees and awarded attorney fees to defendant. These issues remain in controversy, and this court must examine the merits of the underlying suit in order to determine whether the trial court was correct. Eg., Pacific N. W. Dev. Corp. v. Holloway, 274 Or 367, 370, 546 P2d 1063 (1976).

In his pleadings, defendant accused plaintiff of the following improper business practices which defendant contends justified his termination of his employment.

1. The use by plaintiff of false and fictitious personal and business names, particularly in dealing with dissatisfied customers of plaintiff.
2. The use by plaintiff of fraudulent and deceptive practices in the settlement of claims and the realization of illegal profits from such settlements.
3. The use by plaintiff of illegal and secret recording of telephone conversations and personal conversations involving both plaintiff’s customers and plaintiff’s employees, including defendant Oliver.
4. The misrepresentation by plaintiff of the nature of plaintiff’s business, and, in particular, misrep-presenting to plaintiff’s customers that plaintiff is a manufacturer of hardwood.
5. The assessing by plaintiff of additional charges of $15 per thousand board feet for resurfacing lumber, which resurfacing in fact is not done or required.
6. The realization by plaintiff of illegal profits from freight overcharges.
7. The use by plaintiff of deceptive descriptions of products and delivery of orders which have been shorted or lowered in quality.

During the course of trial, defendant expanded the list of claimed instances of misconduct to include:

1. Illegal and secret monitoring of employee telephones.
2. Grossly underpaying its employees.
3. The use of unauthorized truckers in violation of ICC regulations.
4. Denial of rights to its employee stockholders.

At trial, both parties introduced numerous exhibits and extensive testimony relating to these charges. On appeal, defendant also argues that the record shows that plaintiff behaved inequitably by:

1. Invading prospective employees’ privacy with a lengthy questionnaire about their personal lives.
2. Attempting to regulate employees’ personal lives during non-working hours.
3. Discriminating against inexperienced new employees by requiring them to sign a non-competition covenant while not requiring it of experienced new employees.
4. Utilizing an arbitrary and secretive bonus system.

After examining the evidence relating to defendant’s charges, the trial judge made the following findings:

"* * * defendant introduced evidence in support of a contention that plaintiff’s traders were grossly underpaid. These traders were certainly paid upon an ill-defined system. They were certainly paid under conditions of secrecy guaranteed to produce suspicion and unrest. They may not have been paid as much as they might have been paid under some other system by comparable businesses with comparable resources, but underpaid as a class they were not, if one bears in mind the educational background and training required of them in comparison to doctors, lawyers, scientists and civil servants with substantial professional responsibilities. In any event, Oliver was compensated by a fixed salary and a fixed percentage of the department profit, under which he appears to have done rather handsomely.[] The method of payment of traders and the amount of their compensation, however, is relevant insofar as it does, in conjunction with other factors, contribute to an atmosphere of restraint and oppressiveness.
"11. With respect to the charge that plaintiff’s traders posed as a manufacturer of hardwood and deceived customers as to whether lumber had to be resurfaced, such practices occurred in the Hardwood Department and were, at most, rather shabby minor deceptions. They occasioned no loss to customers. With respect to the charge of coercing sawmills, the evidence suggests at most that where North Pacific loaned money to keep a mill afloat it then occupied the position of a preferred buyer. There is no reason why it should not have asserted such a position. With respect to the charge of using illegal haulers, I am satisfied it occurred in several departments, including Hardwood, that management discovered the practice in 1974, and that the practice largely, if not wholly, ceased thereafter with circulation of Mr. Fleischman’s memorandum, Exhibit #94.
"12. With respect to telephone eavesdropping, this practice appears to have occurred in three ways. First, as a training device to enable one inexperienced trader to listen to the conversation of another experienced trader by removing the mouthpiece of the listener’s telephone. I see nothing illegal or improper about that. Under ORS 165.540, the trader who was overheard can be considered to have given his express or implied consent to a reasonable practice. Second, four managers had special telephones which enabled them to plug into conversations on certain other telephones, usually in their department. There is nothing illegal or improper about such "so-called” training telephones, provided the trader knew it was being done and thereby impliedly consented to it. To the extent that such surveillance capacity was unknown, it would be and was illegal under ORS 165.540 and improper. It was unknown in Hardwood. In one department the evidence shows that traders knew of this capacity. However, the corporation’s own mode of secrecy no doubt precluded any rapid spread of such information; "gossip” under company rules was discouraged. Third, there were at least four instances in which corporate executives monitored calls of certain traders for brief periods, either by special wiring of their telephones or by instructing switchboard operators to listen to conversations. In these instances management thought it had valid reason to probe into activity adversely affecting the corporation. Nevertheless, these instances constituted violations of ORS 165.540. In the case of trader Blinkhom, the practice seems to have been an effort to see what defendant Oliver was up to.
"13. The use of fictitious personal names was a practice carried on over a period of many years in Hardwood, as well as other departments. The posting of a checklist for fake names so that switchboard operators could keep the calls straight demonstrates more than a casual practice. It was a deceptive and shoddy practice, probably more damaging to the persons who practiced it than to any persons so deceived.
"14. The making of profit on claims was perhaps the most serious practice charged against the plaintiff. It is clear from the evidence that in the Hardwood Department, under the supervison of the manager, Mr. Justus, traders were encouraged where possible to make money on claims by settling with mills for a greater amount than customers had agreed to accept in settlement of their claims, then pocketing the difference for North Pacific as "extra” profit. In some instances the fraudulent misrepresentation is demonstrated by letters written to both supplier and customer on the same day by the same trader. Defendant’s trader witnesses in the Hardwood Department testified that profit was made on 50% of the claims. Plaintiff disputes this. Plaintiff’s own review of the Hardwood Department files back to 1970 (in no sense an independent audit), disclosed some 83 files in which plaintiff has made restitution to mills or customers. During that same priod there were, according to plaintiff, some 550 files in which claims were made. From its calculations, a profit was made on no more than 13% of the claims. Plaintiff points out also that the dollar amounts involved were small compared to the volume of its business, the total by its count not exceeding some $12,000 in Hardwood. Whatever the percentage, the practice was deliberate, occurred regularly, and was encouraged by the department manager. All traders called by defendant testified to this. No traders were called by plaintiff to deny this practice. I assume they could not.”

The trial judge described the clean hands doctrine as follows:

"* * * [W]hen a person who seeks the aid of a court of equity has himself been guilty of wrong in his prior conduct related to the matters upon which he seeks the aid of the court, he is denied the remedy he seeks, for he comes before the court with unclean hands. Taylor v. Grant, et al., 204 Or 10 (1955). As the Supreme Court makes clear in Taylor, the iniquitous conduct which bars a right to an equitable remedy must relate to the subject matter of the suit and must involve the conscious act of the party against whom it is invoked.” (Citing Taylor v. Grant, 204 Or 10, 279 P2d 479, opinion clarified 204 Or 10, 279 P2d 1037, reh. denied, 204 Or 10, 281 P2d 704.)

The court stated that while the evidence suggested plaintiffs hardwood division manager bore primary responsibility for the misconduct, plaintiff was legally responsible since the manager’s acts fell within the scope of the authority plaintiff had given him and because plaintiff’s president seemed to have accorded those acts his tacit approval. The court did not feel that plaintiff’s efforts to eradicate the practices after they were disclosed in litigation overcame the taint they generated. The court rejected plaintiff’s contention that defendant’s failure to protest the practices foreclosed him from asserting the unclean hands defense. The court found that defendant’s participation in the wrongdoing did not preclude application of the clean hands doctrine. The court asked at one point:

«* * * Would a court of equity permit it to enforce the covenant against a traitor in the light of the practices established? Would a court of equity say to a traitor: 'you must continue to work for such an employer or pay the penalty imposed by the covenant.’ I think not. The employer would be barred from enforcing the covenant. To use the ancient terminology: his hands are unclean.”

Elsewhere the court stated:

"* * * Public policy should preclude enforcement of a covenant not to compete where its effect is to encourage submission to and make difficult departure from an employment where illegal and unethical practices are prevalent. Public policy should encourage all citizens to conform to basic standards of bahavior.”

On the basis of its findings, the court concluded plaintiff had unclean hands and denied enforcement of the contract.

Covenants binding a person not to exercise his trade or profession for a period of time in a particular area are contracts in restraint of trade disfavored at common law. Nonetheless, courts will uphold them where they are reasonably necessary to protect a legitimate interest of the person in whose favor they run, do not impose an unreasonable hardship upon the person against whom they are asserted, and are not injurious to the public interest. Applying these standards, this court held that a covenant similar to the one relied on by plaintiff in this case was valid in North Pacific Lbr. v. Moore, 275 Or 359, 551 P2d 431 (1976). The court upheld a decree and judgment enjoining one of plaintiff’s former employees from violating the covenant and awarding plaintiff damages for injuries suffered as a result of the breach. Here, defendant challenged the validity of the covenant in his pleadings but the trial court held that "the employment contract was and remains a valid contract.” In light of Moore, that determination appears to be correct and Oliver does not press his challenge upon appeal.

The threshold issue in this case is whether the trial court properly refused plaintiff all requested relief in a suit based on an otherwise valid contract because of what the trial court viewed as plaintiff’s unclean hands. The correctness of the trial court’s disposition of the parties’ remaining claims for damages and attorney fees turns on this issue. It is therefore necessary to have some general understanding of the operation of the clean hands maxim.

In his treatise, Pomeroy describes the concept underlying the clean hands maxim, as follows:

"* * * [T]he principle was established from the earliest days, that while the court of chancery could interpose and compel a defendant to comply with the dictates of conscience and good faith with regard to matters outside of the strict rules of the law, or even in contradiction to those rules, while it could act upon the conscience of a defendant and force him to do right and justice, it would never thus interfere on behalf of a plaintiff whose own conduct in connection with the same matter or transaction had been unconscientious or unjust, or marked by a want of good faith, or had violated any of the principles of equity and righteous dealing which it is the purpose of the jurisdiction to sustain. While a court of equity endeavors to promote and enforce justice, good faith, uprightness, fairness, and conscientiousness on the part of the parties who occupy a defensive position in judicial controversies, it no less stringently demands the same from the litigant parties who come before it as plaintiffs or actors in such controversies. This fundamental principle is expressed in the maxim, He who comes into a court of equity must come with clean hands * * 2 Pomeroy, Equity Jurisprudence § 398 at 93-94 (5th ed 1941).

The maxim is applied for the protection of the court and not for the benefit of the defendant, who may in fact be equally affected with the improper transaction. McClintock, Principles of Equity at 60 (1948). The plaintiff may have a perfectly valid claim, but he will nevertheless be denied relief where the doctrine applies.

A wide range of behavior may constitute misconduct under the maxim. As McClintock has noted:

"The application of the maxim * * * is not confined to cases where the transaction is illegal, void or voidable; equity may often refuse to give affirmative relief because of inequitable conduct which does not affect the legal validity of the contract.” McClintock Principles of Equity at 61 (1948).

And Dobbs has said:

"By implication if not by clear course of decisions, unclean hands may be any sort of conduct that equity considers unethical, even if that conduct is perfectly legal.” Dobbs, Remedies§ 2.4 at 46 (1973).

This court has applied the clean hands doctrine where the plaintiffs conduct constituted a crime, Enloe v. Lawson, 146 Or 621, 633, 31 P2d 171 (1934); fraud, Martin v. Tikka, 263 Or 350, 500 P2d 1209 (1972), Casteel v. King, 201 Or 234, 269 P2d 529 (1954); disloyalty to an employer, Olsen v. Producers Life Ins. Co., 250 Or 517, 443 P2d 172 (1968); or bad faith, McKee v. Field, 187 Or 323, 210 P2d 115 (1949). The misconduct may have as its target either the defendant or some third party. Oliphant v. French, 256 Or 341, 472 P2d 275 (1970), accord, Barnhisel v. Watters, 138 Or 8, 4 P2d 316 (1931); Columbia T. & A. Co. v. Thiele, 135 Or 511, 295 P 501 (1931); Page-Dressler Co. v. Meader, 118 Or 359, 244 P 308 (1926). See generally, Fadeley, The Clean-Hands Doctrine in Oregon, 37 Or L Rev 160 (1958).

Broad as the principle seems to be in its operation, it still has some reasonable limitations. In quantitative terms, the misconduct must be serious enough to justify a court’s denying relief on an otherwise valid claim. Even equity does not require saintliness. Perhaps more importantly, the misconduct must bear a certain kind of relationship to the subject matter of the suit before a court will consider it. Since this is the more troublesome of the two limitations, we will examine it in more detail.

According to Pomeroy:

"* * * The maxim, considered as a general rule controlling the administration of equitable relief in particular controversies, is confined to misconduct in regard to, or at all events connected with, the matter in litigation, so that it has in some measure affected the equitable relations subsisting between the two parties, and arising out of the transaction; it does not extend to any misconduct, however gross, which is unconnected with the matter in litigation, and with which the opposite party has no concern. When a court of equity is appealed to for relief it will not go outside of the subject-matter of the controversy, and make its interference to depend upon the character and conduct of the moving party in no way affecting the equitable right which he asserts against the defendant, or the relief which he demands. A court of equity is not an avenger of wrongs committed at large by those who resort to it for relief, however careful it may be to withhold its approval from those which are involved in the subject-matter of the suit, and which prejudicially affect the rights of one against whom relief is sought. The rule does not go so far as to prohibit a court of equity from giving its aid to a bad or a faithless man or a criminal. The dirt upon his hands must be his bad conduct in the transaction complained of. If he is not guilty of inequitable conduct toward the defendant in that transaction, his hands are as clean as the court can require.” 2 Pomeroy, Equity Jurisprudence § 399 at 94-97 (1941).

McClintock provides a slightly different description of this limitation:

"The maxim is subject to the qualification that the inequitable conduct which will defeat plaintiff’s recovery must be conduct with reference to the transaction on which he bases his suit; relief will not be refused merely because of plaintiffs general bad character, nor because of particular acts of misconduct not directly involved in the suit. Even misconduct connected with the subject-matter of the suit will not defeat relief, where it does not form part of the transaction in controversy * * *. Courts are not agreed as to the test to be applied to determine when misconduct is a part of the transaction in suit, and not all of the decisions can be reconciled by any one test. The general principle is that equity will not lend its aid to enable a party to reap the benefit of his misconduct, or to enable him to continue it, but, where the misconduct has ceased and the right claimed in the suit did not accrue because of it, the misconduct will be held to be collateral and not to defeat the right to affirmative relief. This accords with the fundamental purpose of the maxim to protect the court against the odium that would follow its interference to enable a party to profit by his own wrong-doing.” McClintock, Principles of Equity § 26 at 63 (1949).

Dobbs speaks of the clean hands doctrine, as follows:

"[T]his is not a license to destroy the rights of persons whose conduct is unethical. The rule is that unrelated bad conduct is not to be considered against the plaintiff. It is only when the plaintiff’s improper conduct is the source, or part of the source, of his equitable claim, that he is to be barred because of this conduct. 'What is material is not that the plaintiffs hands are dirty, but that he dirties them in acquiring the right he now asserts. * * *’ ” Dobbs, Remedies § 2.4 at 46 (1973).

The principle that a party’s unclean hands will preclude him from obtaining equitable relief only when the wrongdoing is related to the transaction giving rise to the claim is well established in Oregon. In Smith v. Barnes, 129 Or 138, 148, 276 P 1086 (1929), this court said that the doctrine

"* * * does not mean that a court of equity will first appraise the moral worth of each suitor, and if it finds that in the past he has committed some act of iniquity refuse to listen to his complaint; to repel his suit the iniquitous conduct must be attached to the particular matter in respect to which judicial relief is sought.”

See, e.g., Taylor et ux v. Grant et al, 204 Or 10, 279 P2d 479, 279 P2d 2d 1037, 281 P2d 704 (1955); Platt v. Jones, 149 Or 246, 38 P2d 703, 39 P2d 955 (1935). It is now necessary to determine what effect these considerations may have in the case at hand.

As its first assignment of error, plaintiff challenges the trial court’s analysis of the clean hands doctrine and its application of the maxim to the evidence at hand. Plaintiff argues that the defense is only available where plaintiff’s misconduct is directly related to the transaction out of which plaintiff’s claim for relief arose. According to plaintiff, the wrong must be "inextricably connected to the right sought to be enforced” and the "very interest being prosecuted” must have "arisen from plaintiff’s wrongdoing.” Plaintiff claims the question "is not whether this court should punish North Pacific for the alleged and admitted misdeeds of some of its employees, but whether North Pacific’s claim of right against Oliver had its inception in its own wrongdoing.” More specifically, plaintiff asserts:

«* * * ^00£ that the covenant not to compete sought to be enforced and the wrongdoing of North Pacific’s employees both arose within an employment context would not in itself justify application of the clean hands doctrine as a bar. There must be a showing that the covenant not to compete, the right sought to be enforced in this case, arose out of or accrued because of the activities of which Oliver now complains.”

Plaintiff cites Columbia T. & A Co. v. Thiele, supra, and Smith v. Barnes, supra, in support of this proposition. Plaintiff contends the record shows that the misconduct complained of is collateral to plaintiffs claim and that the trial court erred when it denied relief.

Defendant, recognizing the existence of a limit to the clean hands doctrine’s application, alleged in his pleadings that plaintiff required execution of the covenant not to compete as part of a scheme or plan to coerce employees to engage in improper business practices and to prevent the employees from disclosing such practices to others. Defendant did not press this theory at trial and the trial court did not seem to think the clean hands defense required such a showing. On appeal, defendant has modified his argument and replies to plaintiff’s first assignment of error by asserting that

"* * * [Tjhe misconduct of Nor Pac is directly related to defendant and his employment contract in the following ways:
1. The contract, arising out of the routine hiring process at Nor Pac, concealed from Oliver and failed to disclose material facts relating to working conditions, and business practices which were variously characterized by the lower court as shabby, shoddy, deceptive, fraudulent and sometimes illegal.
2. The wrongful business practices continued throughout the term of defendant Oliver’s employment and were at all times in violation of an implied condition in the employment contract that the business practices of Nor Pac would do nothing to injure its own or Oliver’s reputation.
3. The continuous course of wrongful conduct and wrongful acts by Nor Pac justified the termination of his employment by defendant Oliver and his right to ignore the oppressive contract provisions relating to his future employment.”

The parties thus agree that there must be some relationship between the subject matter of the suit and the misconduct alleged, but they disagree as to what the subject matter of the suit is and whether the required relationship exists in this instance.

It is clear we are concerned with litigation arising from the employment relationship which existed between plaintiff and defendant. The parties initially established that relationship by executing an employment contract. The contract contained the covenant plaintiff seeks to rely on. Conceivably, the court could say that execution of the contract was the transaction which formed the subject matter of the suit. If the court adopted this approach we would merely ask whether the plaintiff did anything inequitable with regard to the execution of the contract and stop at that. In a sense, this is the approach urged upon us by both parties. Plaintiff contends that defendant must show that the covenant not to compete arose out of the misconduct; defendant alleges that plaintiff required execution of the covenant as part of a scheme to involve defendant in its wrongdoing, or alternatively, that plaintiff concealed the true nature of the job from plaintiff at the time of the contract’s execution. But the trial court appears to have defined the subject matter of the suit more broadly than either of the parties. The trial court considered evidence relating to all aspects of plaintiff’s operations. Evidence of plaintiff’s misconduct in the course of the creation of defendant’s employment relationship would certainly be relevant to our determination as to whether the clean hands doctrine applied. However, any unethical behavior required of an employee which would justify that employee’s leaving his or her job would also be relevant. Columbia T. & A. Co. v. Thiele, supra, and Smith v. Barnes, supra, the two cases cited by plaintiff, do not dictate a contrary result.

In Columbia T. & A. Co. v. Thiele, supra, five Portland firms which had each been independently engaged in the manufacture and sale of tents and awnings formed a new corporation, Columbia Tent and Awning Co. Defendant Thiele, a principal in one of the five firms, supported and actively participated in the merger of interests. Each tent dealer agreed not to compete either directly or indirectly with Columbia; however, Thiele, in violation of the agreement, entered into competition with the new corporation and the latter filed suit to enforce the covenant not to compete. Thiele argued that the covenant should not be enforced because its underlying purpose was to create an unlawful monopoly by controlling prices and suppressing competition. This court found that although the transaction did not in fact create a monopoly, the manner in which the five merged firms had attempted to control prices and stifle competition constituted the commission of a fraud upon the public. Because of the way in which the business had operated, the court concluded that neither party had come into equity with clean hands and that the trial court was correct in denying enforcement of the covenant.

In Smith v. Barnes, supra, plaintiff, a bootlegger, persuaded defendant to purchase two pieces of property on his behalf. Plaintiff provided the purchase price for both properties. Plaintiff intended, and did in fact use the first property as a base of operations for his illegal liquor trade; plaintiff wished to purchase the second property solely as a personal investment. Later, when defendant refused to transfer the property to plaintiff, he brought suit to establish a resulting trust in the properties. On de novo review, this court refused to aid plaintiff with regard to the property used in plaintiff’s illegal business. The court stated that plaintiffs illegal business was inextricably interwoven with the purchase of the proerty and defendant’s promise to convey it. The court did, however, impose a trust on the second property because its purchase was unrelated to plaintiffs activities as a bootlegger.

These cases do not stand for the proposition that the clean hands doctrine can only be invoked where the unethical conduct produces the right upon which plaintiff sues. Thiele and Barnes say only that the transaction in question must bear some relationship to plaintiffs wrongdoing. That relationship may exist from the outset, as in Barnes, or may develop at some later time, as in Thiele. Our concern is with the totality of the relationship as well as its beginnings.

Cases from other jurisdictions in which courts have applied the clean hands doctrine in suite brought by employers to enforce an employee’s non-competition covenant, suggest that a court should look beyond the circumstances surrounding the contract’s execution and seek to determine whether the employer has performed its contractual obligations during the contract’s life as well. In Professional Beauty Products, Inc. v. Jay, 463 SW2d 288, 290 (Tex Civ App 1970), the court stated: The court found that the employer’s action in establishing an entity which competed with its employee, thereby reducing the employee’s sales and commissions, was wrongful conduct amounting to unclean hands which precluded the employer from obtaining injunctive relief or damages against the employee in a court of equity. In Vaughan v. Kizer, 400 SW2d 586, 589 (Tex Civ App 1966), the court stated:

"It is well settled that a former employer cannot enforce a negative covenant not to compete in a contract of employment by injunction where it has breached that contract.”
"* * * [A]n otherwise valid agreement by an employee not to compete with his employer after termination of employment, may not be enforced by injunction, by the employer, where the employer has been guilty of a breach of the employer’s obligations under the contract or other inequitable conduct.”

The court concluded that the employer’s action in reducing the employee’s expense accounts was such wrongful conduct as to render the employer without clean hands and preclude him from obtaining injunctive relief. See also SCM Corp. v. Triplett Co., 399 SW2d 583, 585 (Tex Civ App 1966), where the court concluded that a trial court did not err in refusing a temporary injunction based on a negative covenant in an employment contract when the evidence suggested that the employer had changed the plan of payment to the employee in breach of the contract’s terms. See generally, Annot., 155 ALR 652 (1945) for additional cases. These decisions suggest that a court can and should consider unethical behavior occurring at any point in the employment relationship.

These cases involved employer misconduct which violated the terms of the contract and injured the employee directly. Cases applying the clean hands doctrine in other contexts suggest that misconduct directed at third parties may also give rise to a clean hands defense. Thiele and Barnes illustrate this point since both those cases involved plaintiff misconduct which injured the public rather than the defendant. We conclude that an employer may be guilty of misconduct amounting to unclean hands if the employer uses, or attempts to use, the employment relationship to involve the defendant in unethical behavior which injures a third party.

The critical question here is whether the employer’s improper conduct "sufficiently affected the equitable relations between the parties” to justify the trial court’s refusal to grant relief. Since this suit arises out of an employment relationship we believe the question can best be answered by seeking to determine whether, under the circumstances, the continued existence of that relationship made it necessary for the defendant to participate with plaintiff in the improper conduct. We are unwilling to permit an employee to terminate his employment contract without obligation whenever his employer commits some indiscretion and the improper conduct concerns a matter with which the employee is not directly concerned. Such a rule would render many contracts unenforceable in equity. Defendant contends that an employee’s reputation necessarily suffers whenever an employer engages in improper conduct and that this in itself justifies application of the clean hands rule. This is, as demonstrated by the texts previously quoted, too broad an application of the rule.

One other aspect of Thiele deserves comment. The court there did not ask why the defendant breached the agreement he had earlier entered into as it sought to determine whether plaintiff should receive affirmative relief. In light of the facts of the case, the probabilities are that he broke it out of self-interest and not out of any desire to be a good citizen. The court presumably did not make this inquiry because the clean hands doctrine is designed to protect the court’s integrity by permitting it to avoid sullying its hands with the enforcement of a corrupt bargain. Taylor v. Grant, supra. While this may work to the benefit of an evil defendant, that result is incidental, and the court does not examine the defendant’s ethical standing to determine whether he deserves such a consideration. Thus, in the proper circumstances, the clean hands defense may be available to an employee who has failed to protest the employer’s misconduct or even participated in it. E.g., Merimac Co. v. Portland Timber & Land Holding Co., 259 Or 573, 488 P2d 465 (1971). With these observations in mind, we will examine the record before us to determine whether any misconduct occurred, whether it was sufficiently serious to constitute unclean hands, and whether it bore the necessary relationship to the subject matter of the suit.

In essence, the trial court based its finding of unclean hands on evidence relating to two of defendant’s numerous charges. They were, first, that plaintiff improperly monitored employee calls and, second, that plaintiff derived improper profits from the settlement of claims. We agree with the trial court in the view he took of the remainder of the allegations.

The record shows that plaintiff had special equipment installed by Pacific Northwest Bell which made it possible for plaintiff’s employees to monitor other employee’s calls, including those of defendant. The record also indicates that employees could monitor other employee’s calls by removing the mouthpiece from their phone and pressing one of the control buttons. Plaintiff encouraged new traders to listen in on experienced traders’ conversations as a training device. The record is unclear whether traders in the hardwood division were actually unaware of the pratice of monitoring trader calls for training purposes. The record also indicates that on at least four occasions plaintiff monitored employee calls in order to spy on the employee and that on one occasion this was done to a trader as a means of discovering what défendant, then an ex-employee, was up to.

It does not appear that plaintiff required defendant to monitor other traders’ calls or that plaintiff ever actually monitored any of defendant’s conversations. In any event, while these activities may have constituted a violation of the statute we do not believe they justify application of the clean hands doctrine against plaintiff. Defendant was not subjected to such conduct nor was he required to monitor others. The practice was not one connected with defendant’s employment. In addition, it is difficult to discern anything venal in the employer’s actions under the circumstances of this case. In every case the plaintiff monitored calls of its employees made during business hours on company phones which presumably related to the conduct of plaintiff’s business with its customers. While this court is aware that the statutes in question involve a legislative expression of public morality which this court will enforce whenever a public authority properly charges a violation, we do not believe the statutes control our application of the clean hands doctrine where the circumstances of the violation do not otherwise appear to dictate a withholding of the aid of the court.

The trial court felt that the most serious charge against plaintiff was that plaintiff made a practice of making improper profits on the resolution of claims. Plaintiff, as a lumber wholesaler, matched up buyers with sellers. The seller of a lumber product generally bore legal responsibility for any deficiency in an order. When a shipment was unsatisfactory, the buyer would register its complaint with plaintiffs traders. The trader then attempted to negotiate a settlement. By downplaying the seriousness of the deficiency, the trader sought to obtain the buyer’s consent to a low settlement figure. The trader could then turn around and tell the supplier that the deficiency was very serious and the buyer demanded a large settlement. Once agreement was reached, plaintiff pocketed the difference between the two figures as additional profit on the transaction.

Plaintiff admits that traders made profits on claims and that lower level management in the hardwood division encouraged the practice. Plaintiff attempts to minimize the significance of its wrongdoing by noting that its review of the records for the 6 1/2 years prior to suit showed that hardwood division traders only made improper profits on 81 of 535 claims handled for a total profit of just $12,000. Plaintiff notes that the division as a whole conducted some 5,500 transactions during those years. Plaintiff claims that its upper level management did not know about the practice until defendant disclosed it in litigation and that plaintiff immediately halted it and refunded all sums its audit disclosed had been improperly obtained. Plaintiff also points out that defendant participated in the practice. Defendant’s witnesses, many of them ex-traders for plaintiff, claim to have made profits on as many as 50 per cent of the claims they handled. They assert that plaintiff’s management knew about the practice and encouraged it through group pressure at departmental meetings and in the hardwood division’s instruction manual.

The court is not persuaded by plaintiff’s evidence with respect to the frequency of the practice since plaintiff’s audit was not independently conducted. The court is convinced that plaintiff and its agents did make profits on a number of claims and that this was improper. The court also believes that plaintiff or its agents knew of the practice and encouraged it at their departmental meetings and in their departmental manual.

It is our conclusion that the trial judge was correct in ruling that this conduct sufficiently affected the relations between the parties to justify invocation of the clean hands rule. The making of profits on customer claims against manufacturers was a common practice in the department in which defendant was employed. It continued over a long period of time during seven and one-half years of which defendant was assistant manager of the department and had responsibility for the supervision of such activities. He derived a personal profit from the misconduct since it affected department earnings and his compensation as assistant manager of the department. Defendant could not occupy the position of assistant manager and avoid participating in his employer’s improper practices because he was responsible for carrying out and overseeing department policy. A court of equity should not lend its aid to an employer who attempts to enforce a contract of employment, the performance of which involves participation by the employee in such wrongdoing. We do not refuse the court’s aid in order to punish plaintiff or reward defendant but only to avoid involving ourselves in settling accounts arising from a tainted relationship.

Having concluded that the trial court properly refused to enforce plaintiff’s contract with defendant, we must next decide whether defendant was entitled to an award of attorney fees. The contract contained a clause authorizing plaintiff to seek attorney’s fees in a suit or action to enforce the contract. ORS 20.096 provides that courts may award reasonable attorney fees to the prevailing party in a suit on a contract if the contract permits one party to seek attorney fees whether or not the prevailing party is the party so specified in the contract. Defendant counterclaimed for attorney fees. In its opinion the trial court declared:

"The matter of attorneys fees must be considered separately. The covenant not to compete contains a provision authorizing the recovery of attorneys fees should plaintiff prevail. Plaintiff not being entitled to prevail, defendant is therefore entitled to recover his reasonable attorneys fees. This result follows automatically from the application of ORS 20.096. However, equity should reach the same result in this case. Plaintiff, through management, allowed these illegal and improper practices to develop. Plaintiff compelled defendant to defend himself against serious economic loss. Defendant, in point of fact, has performed a service to plaintiff in focusing the attention of management upon these practices so that corrective action can be taken.”

The court concluded that defendant was entitled to reasonable attorney fees. Following the receipt of testimony, evidence, supplemental briefs and argument of counsel concerning attorneys fees, the court awarded defendant $105,000. Plaintiff appeals that portion of the decision, contending that since defendant also had unclean hands with respect to the transaction, it was improper for an equity court to award him affirmative relief in the form of attorney fees.

The record shows that defendant knew it was customary to make a profit on claims and that defendant received a personal benefit from the activity in the form of a percentage of department profits. Defendant does not appear to have left plaintiffs employ because of these activities. Rather, the record suggests that defendant left plaintiff’s employ for other reasons. The practice of making a profit on settlements between manufacturer and purchaser went on for more than seven years while defendant was assistant manager. One would have to be a trifle credulous to believe that after this length of time he, all of a sudden, got religion and could no longer stand the practice. Defendant was unhappy with plaintiffs compensation system and disliked his immediate supervisor.

This is not the first time this court has faced a situation in which both parties appeared to have unclean hands. In Thompson v. Spint, 247 Or 484, 430 P2d 1014 (1967), plaintiff brought a quiet title suit against defendants. The defendants had conveyed the property in question to plaintiff for the purpose of placing the property beyond the reach of defendants’ creditors. Only one of the defendants answered. He prayed that he and the other defendant be adjudged tenants in common in the property in dispute. The trial court found that defendant had participated in the scheme to defeat creditors and this barred him from equitable relief under the clean hands doctrine. The court quieted title in plaintiff and defendant appealed.

This court agreed with the trial court that defendant had participated in the scheme to defeat creditors and that the clean hands doctrine barred him from equitable relief. However, we also found that the evidence showed that plaintiff was an active participant in the fraudulent scheme and that she too should have been denied relief under the clean hands doctrine. We reversed the decree of the trial court and remanded with directions to enter a decree dismissing plaintiff’s complaint and denying the relief prayed for in defendant’s affirmative answer.

It is our conclusion that defendant here also lacked clean hands with respect to the subject matter of the suit. We do not believe defendant terminated his employment because of plaintiffs illicit practices. He did so because he was dissatisfied with pay and personnel and because he was as culpable as plaintiff. Even though plaintiff had a valid contract providing for attorney fees, plaintiff’s conduct of its business put it in a position where the contract is unenforceable. Defendant is guilty of the same conduct because for seven years he knowingly participated in the ill gotten gains; however, he contends that he is nonetheless entitled to an affirmative award on his counterclaim for attorney fees since his claim therefor is based on a statute.

A court of equity is bound by the statute and the problem is merely one of statutory construction. It is reasonably clear that the purpose of the legislature was to equalize the rights of disfavored parties to adhesion contracts who lacked bargaining power. See legislative history of the statute as set forth in McMillan v. Golden, 262 Or 317, 497 P2d 1166 (1972). It was not intended to give the disfavored party rights superior to those of the favored party. Had the present contract provided for attorney fees for both parties, we would not have granted defendant’s request for affirmative relief nor enforced the provision for attorney fees in favor of defendant because of his participation in the thievery of which he complains any more than we would enforce this and other provisions of the contract in favor of plaintiff. It surely was not the intention of the legislature to place the disfavored party in a superior position to that which he would have enjoyed had the contract granted him equal rights to attorney fees with the favored party.

McMillan v. Golden, supra, in a different factual context recognized that the statute established no independent right when it said "* * * whether either party is entitled to attorney fees is still dependent on the existence of a specific contract provision.” 262 Or at 321. In equity all contractual provisions are subject to the defense of clean hands and defendant’s rights under the statute should be no greater than a contractual provision would have afforded him.

In Webster v. General Motors Accept., 267 Or 304, 516 P2d 1275 (1973), we held that the prevailing party, who was disfavored by the contract, was entitled to attorney fees but that the amount he could recover was limited by the amount of work performed for him prior to a refused offer of compromise. This limitation on recovery of fees was applied despite the lack of any such limitation in the statute.

While neither of these cases is directly in point, each demonstrates that the statute has been construed as not establishing an independent right to attorney fees in the prevailing party greater than he would have enjoyed had the contract expressly provided for them. Although the trial court properly refused to aid plaintiff in enforcing the contract due to plaintiff’s unclean hands and defendant in this sense "prevailed,” as an equity court we do not believe defendant was sufficiently free of fault with respect to the events leading to this litigation to justify an affirmative award to him of attorney fees. Under the circumstances, we believe it is proper to leave the parties as we found them. We so hold.

The decree of the trial court dismissing plaintiff’s complaint is affirmed, but it is modified by the deletion of the provision for attorney fées for defendant. Costs are allowed to neither party. 
      
       "In the event of termination of employment by Employee for whatever reason, Employee agrees to refrain from competing, as hereinafter defined, with Employer for a period of time equal to the length of his employment by Employer, or for two (2) years, whichever is lesser.”
     
      
       "6. It is agreed between the parties that the following constitute reasonable restrictions and a reasonable definition of 'completion’ which shall, as applicable, be deemed in contravention of the terms of this agreement:
      "(A) Employee shall not operate as a wholesaler, broker or commission man of forest products, or become employed by or associated in business with others so operating within an area of one hundred (100) miles from the boundaries of the City of Portland, Oregon, if such forest products are being handled by Nor Pac at the time of termination of Employee’s employment.
      "(B) Employee shall not, during the restricted period, become employed by or associated in business with or purchase from or sell to Employer’s regular suppliers or regular customers as hereinafter defined and limited. Employer’s regular suppliers shall be construed to mean suppliers in the United States from whom Employer has purchased during a period of one year immediately preceding termination of Employee’s employment with Employer, ten (10) carloads or more of said forest products, and Employer’s regular customers shall be construed to mean customers within the United States, to whom Employer has sold within said one-year period not fewer than six (6) carloads of forest products.
      "(C) The Employer’s operations are divided into the following divisions and departments:
      «>!« }■< sfc >¡«
      "(6) Hardwood Division
      «>■«
      "(D) In order to reasonably limit the restrictive effect of this agreement upon a particular employee, it is agreed that as to him, Employer’s regular suppliers and regular customers shall be limited to those who have a reasonable connection with the commodity, supplier or customer list of the department by which he is employed, or other departments handling closely allied commodities, suppliers or customers, and the following shall be deemed to include such reasonable restrictions:
      >¡< >}«
      "* * * Those in the Hardwood Division are restricted to the Hardwood Division only. * * *.
      ******
      "(7) Employer estimates that its total customer list is composed of approximately eighty-five thousand (85,000) names. It is anticipated that Employee herein is being restricted with respect to not more than six hundred (600) customers and two hundred (200) suppliers, which the parties agree is a reasonable restriction.”
     
      
       "8. In the event that Employee violates any of the terms or conditions of this agreement, Employer shall be entitled to an injunction, to be issued by any court of equity, enjoining and restraining Employee from continuing said violation, and in addition shall be entitled to any damages suffered by Employer.”
     
      
       "9. Employee agrees that in the event that suit or action is instituted by Employer to enforce this agreement or any of the terms or conditions thereof, that Employee will pay to Employer, in addition to any damages awarded to Employer by any court in which said suit or action may be had, a reasonable sum as attorney’s fees in said suit or action.
     
      
       ORS 20.096 provides:
      "(1) In any action or suit on a contract, where such contract specifically provides that attorney fees and costs incurred to enforce the provisions of the contract shall be awarded to one of the parties, the prevailing party, whether he is the party specified in the contract or not, at trial or on appeal, shall be entitled to reasonable attorney fees in addition to costs and necessary disbursements.”
     
      
       Defendant earned as much as $80,000 a year.
     
      
       Defendant contends that plaintiff conceded during trial that the prevailing party was entitled to attorney fees. There was language between the court and counsel which could be so construed. However, the official file shows a memorandum on the subject of attorney fees filed by plaintiff with the court in which it was contended that
      "It has always been our contention that Oliver, having admittedly participated in the wrongdoing complained of, * * * has no standing to ask this court for any relief. To reward him further by allowance of excessive attorney fees would only compound the inequity.”
      We, therefore, believe the issue of whether defendant was entitled to affirmative relief by way of attorney fees because he also had unclean hands was raised before the trial court.
     