
36 Wn. App. 353 (1984)
674 P.2d 208
MARGUERITE M. ANDERSON, Appellant,
v.
DENNIS FRANDSEN, ET AL, Respondents.
No. 10583-3-I.
The Court of Appeals of Washington, Division One.
January 5, 1984.
*354 Gary L. Wolfstone and Michael N. Rosen, for appellant.
Michael R. Alfieri, for respondents.
SWANSON, J.
This case involves a contract dispute. Marguerite M. Anderson appeals a judgment in favor of Dennis and Donna Frandsen. Anderson alleges that the trial court's findings of fact were not supported by the evidence and that the Frandsens' defense and counterclaim are barred because Dennis Frandsen had failed to register as a contractor.
The parties agree on a number of pertinent facts. On May 22, 1975, Donna Frandsen signed a promissory note for $5,000 borrowed from Anderson. The note became due in November 1975, but the Frandsens could not pay. During November, the parties agreed that Dennis Frandsen would work on property owned by Anderson for installation of a mobile home. Frandsen had some work completed on the property. On December 1, 1975, Dennis Frandsen signed a receipt for $4,450 from Anderson. Anderson retained the promissory note.
The parties primarily disagree about what constituted the consideration for the work performed on the mobile homesite. Anderson testified that the work on her property was a separate transaction for which she paid $4,450 in cash, evidenced by the signed receipt. The Frandsens contend that the parties agreed that the work on Anderson's property would constitute payment on the $5,000 note and that they received no payment other than the $5,000 originally borrowed.
Anderson filed a complaint against the Frandsens for payment on the note. The Frandsens answered and counterclaimed for $1,500, the value of Mr. Frandsen's work they claimed exceeded $5,000. The trial court dismissed both claims, entering findings of fact that essentially agree with the Frandsens' theory of what constituted consideration *355 for the work performed. The court found:
II
In 1975 the plaintiff lent to the defendants the sum of $5,000.00. Said loan was subsequently evidenced by a note signed by the defendant, Donna M. Frandsen.
III
The defendants performed services and provided labor and materials for the benefit of the plaintiff in the approximate sum of $5,000.00.
IV
The plaintiff has failed to sustain the burden of proof that the sum of $5,000.00 was due and owing by the defendant and the defendants have failed to prove by a preponderance of evidence that more than $5,000.00 was performed in services or provided in materials and labor for the benefit of the plaintiff.
Anderson first challenges the trial court's findings that indicate Mr. Frandsen's construction work on Anderson's property constituted consideration for the $5,000 Anderson loaned the Frandsens.
[1] In reviewing findings of fact the test is whether they are supported by substantial evidence. Ridgeview Properties v. Starbuck, 96 Wn.2d 716, 719, 638 P.2d 1231 (1982). It must be remembered that it is the trial judge's function to determine the credibility of witnesses. Christgard, Inc. v. Christensen, 29 Wn. App. 18, 26, 627 P.2d 136 (1981). A review of the record discloses substantial evidence supportive of the court's findings.
Anderson also argues that RCW 18.27.080 bars the Frandsens from claiming as a defense that he performed the construction work. RCW 18.27.080 provides:
No person engaged in the business or acting in the capacity of a contractor may bring or maintain any action in any court of this state for the collection of compensation for the performance of any work or for breach of any contract for which registration is required under this chapter without alleging and proving that he was a duly registered contractor and held a current and valid certificate of registration at the time he contracted for the performance of such work or entered into such contract.
*356 The Frandsens concede that Mr. Frandsen was not registered. Consequently, the issue here is whether a contractor who fails to register as required by RCW 18.27.080 is prevented from claiming as a defense that he provided construction work to fulfill a previously existing obligation.
[2] We hold that RCW 18.27.080 only prohibits actions brought by the contractor; it does not prevent an unlicensed contractor from claiming that he performed work as a defense to a claim for reimbursement. As stated in Vedder v. Spellman, 78 Wn.2d 834, 838, 480 P.2d 207 (1971):
It is true that the act does not give the innocent party a right to reimbursement if he has paid the contractor. Thus, a contractor who has been paid voluntarily is apparently allowed to retain the benefits of his unlawful act.
A California court construing a statute similar to Washington's has also concluded the statute does not bar asserting performance of the work as a defense to an action for reimbursement. See Marshall v. Von Zumwalt, 120 Cal. App.2d 807, 262 P.2d 363 (1953).[1] Further, a Washington commentator has recognized the fairness of the approach. See 14 Gonz. L. Rev. 647, 662-63 (1979). Accordingly, the statute does not bar the Frandsens from asserting as a defense that *357 they performed work to fulfill their obligation on the note.
We affirm the judgment of dismissal.
ANDERSEN and RINGOLD, JJ., concur.
NOTES
[1]  The California case involved a situation similar to the present case. There, the plaintiff had loaned the defendant contractor $1,400 to start construction of a house for plaintiff. On appeal one issue was whether a California statute barred the defendant, an unregistered contractor, from claiming he performed work under the contract. The court explained:

Section 7031 of the Business and Professions Code of California reads as follows: "No person in the business or acting in the capacity of a contractor, may bring or maintain any action in any court of this State for the collection of compensation for the performance of any act or contract for which a license is required by this chapter without alleging and proving that he was a duly licensed contractor at all times during the performance of such act or contract." (Italics added.)
It is to be noted that the statute merely prohibits a contractor from maintaining or bringing an action upon a contract which he has entered into pertaining to the contracting business. It does not prohibit him when sued from setting up as a defense any sums which may be equitably due him from the plaintiff upon such illegal contract.
Marshall v. Von Zumwalt, 120 Cal. App.2d 807, 809-10, 262 P.2d 363, 364 (1953).
