
87 Cal.App.2d 233 (1948)
VIRGIL W. CASH, Appellant,
v.
JOHN R. BLACKETT et al., Respondents.
Civ. No. 3922. 
California Court of Appeals. Fourth Dist.  
Aug. 17, 1948.
 Ruel Liggett and Harry C. Clark for Appellant.
 Thomas M. Hamilton for Respondents.
 GRIFFIN, J.
 Action to foreclose mechanic's lien and to recover money judgment. Under written agreement plaintiff agreed to build and construct a building or night club for defendants, which building was completed. He filed a complaint in four counts. Count 1 was for the fair and reasonable value of his services performed and for the material bought for defendants; Counts 2 and 3 are alternative statements of his claim for his own services and an alternative statement for material bought for defendant; Count 4 is an alternative statement of his claim for the total amount in which he pleads the written contract between the parties which specifically sets forth the nature of the contract and the duties and liabilities of the parties.
 The contract provides, in substance, that in consideration of 10 per cent of the total cost of the buildings and operations plaintiff would build the building, prepare preliminary sketches, detailed drawings and specifications, and give general supervision of all building operations; that plaintiff would segregate the various items of labor and material going into the building and award them as individual contracts according to his own judgment. It provides then for an audit, twice a month, of all labor, material paid or payable, subcontracts performed, and that defendants then would pay plaintiff that amount and plaintiff would then pay all bills to date. The method of paying plaintiff's compensation was under a graduated scale. The 10 per cent basic fee included all architectural services and is computed on the total cost of construction. In case defendants discontinued the work plaintiff was to recover 10 per cent of the estimated cost of the completed building, and should the building not be completed, then defendants were to pay plaintiff for the balance, four per cent of that total estimated cost. It then provided that it was agreed and understood that plaintiff was not a registered architect. Plaintiff seeks a judgment for $7,959.43, and foreclosure of his lien *235
 Defendants answered the complaint, denied all allegations but admitted the due execution of the written instrument; alleged that plaintiff, at no time mentioned in his complaint, was a duly licensed contractor; and that the building was completed on February 21, 1946. By way of cross-complaint defendants alleged that they paid plaintiff $42,307.10, at which time he was not a licensed contractor, and they ask judgment against him in that amount.
 In answer to the cross-complaint plaintiff alleges that the money was paid to him by defendants, not as an independent contractor, but as defendants' employee and that at all times defendants well knew that plaintiff was not a licensed contractor nor a licensed architect.
 A jury was empaneled to try the issues thus presented. Counsel for plaintiff made an opening statement to the jury, in substance as follows: He told them that his statement was not evidence "but simply to outline to you in a general way what the parties expect to prove"; "... Now I think the evidence will show ... that Mr. Cash ... has had considerable skill and experience in the preparations of plans and specifications for the building of structures. However, he is not a contractor and does not have a license as such, and neither is he what we would call a licensed architect. ... He is what we might call an unlicensed architect"; that in 1940, defendants started using Mr. Cash's advice and supervision in the remodeling of various places for them; that he believed the evidence would show that one contractor who started on the matter, sort of a general contractor, was not able to go through with it and another one was engaged; and "I believe the man who did most of the work, the general contractor on the place, will be shown to be a man by the name of Hutchinson, who was a licensed contractor"; that Mr. Cash's duties were confined to those of preparing plans and specifications and supervising the work and finding materials; that as the work progressed Cash would present bills from material people, presented his plans, and was paid, from time to time by defendants; that defendants are defending themselves by saying that plaintiff did not have a license; and that "those are the issues."
 Defendants' counsel then moved for a nonsuit under section 581, Code of Civil Procedure, and then argued that the pleadings, contract, and statement of counsel conclusively showed that plaintiff violated sections 5536 and 5537, and sections 7026-28-30-31 of the Business and Professions Code, *236 and by reason thereof was barred from a recovery. The motion was granted and judgment of nonsuit followed.
 Plaintiff states in his brief that the sole issue or question of law presented is that since the complaint states four separate counts and that it is only in the fourth count that the contract is referred to, the court erred in granting the nonsuit upon the ground that plaintiff had no contractor's license or certificate to practice architecture, because, under his statement of the evidence sought to be proved and the pleadings, he may be able to establish that plaintiff was entitled to recover under some one or more particular counts if not under the count setting forth the contract or agreement; that even though the written agreement may be illegal or unenforceable he may enforce his demand or some portion of it without resorting to the contract, the bad being severable from the good. (Citing Wayman Investment Co. v. Wessinger & Wagner, 13 Cal.App. 108 [108 P. 1022].)
 [1] From a reading of the written agreement and from counsel's own statement to the jury as to the transaction here involved, it affirmatively appears that plaintiff's right of recovery upon any count must be based upon the written agreement pleaded. There is no other agreement suggested or referred to in the pleadings or statement to the jury. Therefore, the trial court was called upon to construe the written agreement according to its terms. Such is our duty too. The pleadings, the contract and statement of facts which counsel could rightfully prove affirmatively show that all the acts for which compensation is sought were performed pursuant to that agreement and by the terms of it plaintiff was to receive costs plus 10 per cent.
 [2] Counsel's argument that he might establish by the evidence that plaintiff was not in fact the principal contractor is dispelled by the holding in Payne v. De Vaughn, 77 Cal.App. 399 [246 P. 1069], where it was held that "An unlicensed architect cannot avoid the effect of the statute upon the theory that, although he was a contracting party, prepared the plans and specifications, and agreed to supervise the construction, the contract was legal because in reality he was not the principal architect, where the latter was not a party to the contract."
 [3] It therefore does not appear that plaintiff's claim for compensation as an agent of defendants or as an architect, as distinguished from that of a contractor, was severable, or if severable, that he was an unlicensed architect whose acts would *237 permit him to recover as one coming within the exception set forth in section 5537 of the Business and Professions Code. (17 C.J.S., p. 291; Kirman v. Borzage, 65 Cal.App.2d 156 [150 P.2d 3]; Moon v. Goldstein, 69 Cal.App.2d Supp. 800 [158 P.2d 1004].)
 In Phillips v. McIntosh, 51 Cal.App.2d 340 [124 P.2d 835], plaintiff sought to recover for work performed and material furnished. At the close of plaintiff's case the court granted a nonsuit for failure of plaintiff to comply with section 7031, supra. There the evidence showed that the plaintiff charged defendant 15 per cent upon all materials and labor furnished by her. It was held that in an action for work performed and materials furnished, evidence showing that plaintiff made a profit upon the labor of others, that she charged a certain percentage over and above the cost of materials, and that she performed no labor herself brought the case within the purview of the Business and Professions Code, section 7031, precluding a contractor from maintaining an action for services contracted for unless she proves that she has a contractor's license.
 [4] Alvarado v. Davis, 115 Cal.App.Supp. 782 [6 P.2d 121], specifically denies to an unlicensed contractor the right to foreclose his mechanic's lien.
 Plaintiff cites such cases as Payne v. De Vaughn, supra; Jones v. Wickstrom, 92 Cal.App. 292 [268 P. 449]; and People v. Allied Architects' Assn., 201 Cal. 428 [257 P. 511]. These cases do not support the proposition that one may gain immunity from Business and Professions Code, sections 7026, 7028 and 7031, simply by stating that he has no architect's license, if in fact he performs or contracts to perform acts, as the plaintiff here has done, which bring him within the definition of "contractor," as defined in section 7026, supra.
 [5] The public policy involved here has been determined by the Legislature; it is not a subject of debate in the courts. (Howard v. State of California, 85 Cal.App.2d 361 [193 P.2d. 11].)
 Judgment affirmed.
 Barnard, P. J., concurred.
