
9 Cal.4th 738 (1995)
889 P.2d 970
38 Cal. Rptr.2d 650
LISA GRANBERRY et al., Plaintiffs and Appellants,
v.
ISLAY INVESTMENTS et al., Defendants and Appellants.
Docket No. S035591.
Supreme Court of California.
March 6, 1995.
*741 COUNSEL
Hill, Schwartz & Stenson, David H. Schwartz, Michael P. Guta and Ernest L. Graves for Plaintiffs and Appellants.
Daniel E. Lungren, Attorney General, Roderick E. Walston, Chief Assistant Attorney General, and Yeoryios C. Apallas, Deputy Attorney General, as Amici Curiae on behalf of Plaintiffs and Appellants.
Diane M. Matsinger, Betty L. Jeppesen, Antonio R. Romasanta, Crahan, Javelera, Ver Halen & Aull and Marcus E. Crahan, Jr., for Defendants and Appellants.
OPINION
MOSK, J.
An important provision of our statutory landlord-tenant law provides that within three weeks after the termination of tenancy a landlord must return the security deposit paid by a former tenant and provide a written accounting of any portion retained as compensation for unpaid rent, repairs, and cleaning. (Civ. Code, § 1950.5, subd. (f).)[1] We granted review to determine whether a landlord who in good faith fails to comply with the requirements of this statute may nevertheless recover damages for unpaid rent, repairs, and cleaning in a subsequent judicial proceeding. We also consider whether the trial court abused its discretion by not requiring defendants to disgorge all security deposits received from the members of the plaintiff class and to pay this money into a fund. Finally, we consider whether the court abused its discretion by limiting the award of attorney fees and costs to 25 percent of the total class recovery.
We conclude that a good faith failure to comply with section 1950.5, subdivision (f), does not bar a landlord from recovering damages for unpaid *742 rent, repairs, and cleaning, and we agree with the Court of Appeal to the extent that it so held. We disagree with its view of the remaining issues, however, and hence reverse its judgment to permit the trial court to reconsider its choice of remedy and limitation on attorney fees.

FACTS
Defendants own or operate between 1,200 and 1,500 residential rental units in the Santa Barbara area. During the period relevant to this case, April 27, 1978, to April 27, 1981, it was defendants' practice to charge tenants an increased rental fee for the first 31 days of tenancy, but to charge a reduced fee for all subsequent months.[2] Defendants never returned this fee in whole or in part; rather, they simply retained it as part of the rental payment for the first month. Approximately 10,000 tenants paid such fees during the relevant period, and the aggregate amount of such fees was approximately $1 million.
Plaintiffs, a class of former tenants, sued for a refund of the amount by which the rent they had paid for the first 31 days of their tenancy exceeded the amount they paid in each of the following months. The court entered summary judgment in favor of defendants on the ground that the increased rent paid during the first month was in fact rent and not a security deposit within the meaning of section 1950.5, subdivision (b),[3] and therefore plaintiffs were not entitled to a refund. In an earlier appeal the Court of Appeal reversed, holding that the character of the payment was a triable issue of fact. (Granberry v. Islay Investments, supra, 161 Cal. App.3d 382.) On remand, the court granted defendants leave to amend their answer to allege they were entitled to set off amounts owed to them for unpaid rent, repair, and cleaning if a jury were to find the increased rental payment was a refundable security deposit.
Plaintiffs subsequently moved for summary judgment on the question whether defendants were entitled to a setoff in view of the fact that they had *743 failed to comply with the requirements of section 1950.5, subdivision (f). The court granted the motion. A jury thereafter found that the excess rental payments were security deposits within the meaning of section 1950.5, subdivision (b), but that defendants had not retained them in bad faith. The court ruled that the excess fees must be refunded to the members of the class who made individual claims, but it did not require defendants to disgorge the aggregate amount of the security deposits they wrongfully retained and to pay that money into a fund. The judgment also awarded costs and attorney fees to plaintiffs, but provided that such items would be recovered from the aggregate amount paid by defendants and would not exceed 25 percent of the total amount claimed by the individual members of the class.
In a second appeal the Court of Appeal held (1) the trial court erred in ruling that defendants were not entitled to a setoff, (2) the court did not abuse its discretion in granting refunds only to those class members who came forward to claim them, and (3) it was not an abuse of discretion to limit the award of attorney fees and costs to 25 percent of the total amount paid to the class. Although the Court of Appeal purported to reverse the judgment in its entirety, it in fact impliedly affirmed the judgment as to the second and third of these issues.[4]

I.
During the three-year period relevant to this litigation, plaintiffs vacated apartments rented from defendants but did not receive a written accounting of the basis for, or the amount of, the security deposits retained or the disposition of these security deposits. Nor did plaintiffs receive a refund of any portion of their security deposits. Accordingly, both the trial court and the Court of Appeal correctly concluded that defendants failed to comply with section 1950.5, subdivision (f). (1a) The issue now before us is whether, notwithstanding their good faith lack of compliance, defendants may set off amounts allegedly due for unpaid rent, repairs, and cleaning against money due plaintiffs as a refund of their security deposits. We conclude that defendants may do so.
The English chancery courts allowed setoff to be raised as a defense as early as the 17th century. (Prudential Reinsurance Co. v. Superior Court (1992) 3 Cal.4th 1118, 1124 [14 Cal. Rptr.2d 749, 842 P.2d 48]; 3 Story, Commentaries on Equity Jurisprudence (14th ed. 1918) § 1867, pp. 468-469; *744 see also Tigar, Automatic Extinction of Cross-Demands: Compensatio From Rome to California (1965) 53 Cal.L.Rev. 224 [tracing the history of setoff to the Roman law concept of compensatio].) It was founded on the equitable principle that "either party to a transaction involving mutual debts and credits can strike a balance, holding himself owing or entitled only to the net difference, ..." (Kruger v. Wells Fargo Bank (1974) 11 Cal.3d 352, 362 [113 Cal. Rptr. 449, 521 P.2d 441, 65 A.L.R.3d 1266].) Setoff, as it applies to this case, is now codified as section 431.70 of the Code of Civil Procedure, which provides in pertinent part: "Where cross-demands for money have existed between persons at any point in time when neither demand was barred by the statute of limitations, and an action is thereafter commenced by one such person, the other person may assert in the answer the defense of payment in that the two demands are compensated for so far as they equal each other, ..." (2) The quoted statute, however, does not create a substantive right to raise setoff as a defense to a claim for monetary relief, but merely describes the procedures to be followed in raising this defense. (Kruger v. Wells Fargo Bank, supra, 11 Cal.3d 352, 362; Hauger v. Gates (1954) 42 Cal.2d 752, 755 [269 P.2d 609].) To determine whether setoff is available in this case, we must turn to section 1950.5.
(1b) We first consider whether to allow a landlord to raise setoff even though he has failed to comply with the requirements of section 1950.5, subdivision (f), is consistent with the legislative intent underlying that statute. (See Prudential Reinsurance Co. v. Superior Court, supra, 3 Cal.4th 1118, 1125.) "In determining intent, we look first to the words themselves. [Citations.] When the language is clear and unambiguous, there is no need for construction. [Citations.] When the language is susceptible of more than one reasonable interpretation, however, we look to a variety of extrinsic aids, including the ostensible objects to be achieved, the evils to be remedied, the legislative history, public policy, contemporaneous administrative construction, and the statutory scheme of which the statute is a part. [Citations.]" (People v. Woodhead (1987) 43 Cal.3d 1002, 1007-1008 [239 Cal. Rptr. 656, 741 P.2d 154].)
Section 1950.5, subdivision (e), allows a landlord to claim any portion of the security deposit reasonably necessary to compensate for unpaid rent, repairs, and cleaning. Section 1950.5, subdivision (f), provides in pertinent part: "Within three weeks after the tenant has vacated the premises, the landlord shall furnish the tenant ... a copy of an itemized statement indicating the basis for, and the amount of, any security received and the disposition of the security and shall return any remaining portion of the security to the tenant." (3) From the plain language of the statute we conclude that a landlord (1) must return a tenant's security deposit within the *745 specified period after the termination of the tenancy, (2) may retain all or part of the security deposit as compensation for unpaid rent, repairs, and cleaning, and (3) must provide a written accounting of any amounts retained within the specified period. If, within the specified period, the landlord has not provided the tenant with a written accounting of the portion of the security deposit he plans to retain, the right to retain all or part of the security deposit under section 1950.5, subdivision (f), has not been perfected, and he must return the entire deposit to the tenant. (1c) Nevertheless, the mere fact that the landlord has lost the right to take advantage of the summary deduct-and-retain procedure of section 1950.5, subdivision (f), does not lead to the conclusion that he has lost all right to claim damages for unpaid rent, repair, and cleaning, whether through setoff or otherwise. The language of section 1950.5, subdivision (f), offers no clear guidance on this issue. Accordingly, we must look to the legislative history of section 1950.5 to determine the intent of the Legislature on this point. (People v. Woodhead, supra, 43 Cal.3d 1002, 1008.)
In 1970, the Legislature enacted section 1951, the predecessor of section 1950.5. Former section 1951, subdivision (c), provided: "The landlord may claim of such payment or deposit only such amounts as are reasonably necessary to remedy tenant defaults in the payment of rent, to repair damages to the premises caused by the tenant, or to clean such premises upon termination of the tenancy, if the payment or deposit is made for any or all of those specific purposes. Any remaining portion of such payment or deposit shall be returned to the tenant no later than two weeks after termination of his tenancy." (Stats. 1970, ch. 1317, p. 2453.) Ostensibly, the Legislature enacted section 1951, subdivision (c), to prevent the misuse of security deposits, which one contemporary commentator described as follows: "Theoretically, the security deposits are created to insure against the contingencies of unpaid rents, tenant-inflicted damages, and unclean premises at the termination of the lease. Any claim as to the retention of these funds by the landlord arises only at such time as there has been a breach of the tenant's obligation and an assessment of damage. However, the security deposit in actuality has evolved into a bonus to be kept by the landlord upon termination of the lease agreement regardless of the damages actually sustained by the landlord. Landlords will retain security deposits after the departure of a tenant secure in the knowledge that a former tenant is severely inhibited from initiating legal action. This restraint is a product of a combination of factors including problems of proof, the relatively small sum of money at issue, the time factor, and the distance now separating the tenant from his former landlord. Where the reimbursement is forthcoming, usually the payments are delayed, the application of the retained amounts unitemized, and the interim retention and use of the funds having been without cost *746 to the landlord." (Jory, The Residential Lease: Some Innovations for Improving the Landlord-Tenant Relationship (1971) 3 U.C. Davis L.Rev. 31, 38-39, fns. omitted; see also Bosshardt, The Rental Security Deposit in California (1971) 22 Hastings L.J. 1373.) In 1972, the Legislature renumbered section 1951 as section 1950.5, but did not change the wording of subdivision (c). Finally, in 1977, the Legislature enacted the version of section 1950.5 in effect during the events of this case (now section 1950.5, subdivision (f)).
From the foregoing history it is apparent that section 1950.5, subdivision (f), was enacted to ensure the speedy return of security deposits on the termination of tenancy and to prevent the improper retention of such deposits. However, like the Court of Appeal, we find no conclusive evidence in the legislative history of section 1950.5 regarding the specific issue we now address  namely, whether a landlord may recover damages for unpaid rent, repair, and cleaning even if he has failed in good faith to avail himself of the summary deduct-and-retain procedure permitted under section 1950.5, subdivision (f).
Defendants note that the original draft of a bill proposed in 1985 would have added language to section 1950.5 specifically denying offsets for landlords that fail to comply with section 1950.5, subdivision (f), but this language was deleted from the bill prior to enactment. They contend that this proves that the Legislature, at least in 1985, intended to allow offsets. In response, plaintiffs note that defendants urged the passage of two bills, one in 1990 and another in 1991, but that these bills also failed. Again like the Court of Appeal, we find these arguments unpersuasive. As we have often observed, "Unpassed bills, as evidences of legislative intent, have little value." (Dyna-Med, Inc. v. Fair Employment & Housing Com. (1987) 43 Cal.3d 1379, 1396 [241 Cal. Rptr. 67, 743 P.2d 1323]; accord, Grupe Development Co. v. Superior Court (1993) 4 Cal.4th 911, 922-923 [16 Cal. Rptr.2d 226, 844 P.2d 545].)
Defendants also remind us that we should construe section 1950.5, subdivision (f), in a way that will give effect to section 1950.5 as a whole, leaving no part useless or deprived of meaning. (Gay Law Students Assn. v. Pacific Tel. & Tel. Co. (1979) 24 Cal.3d 458, 478 [156 Cal. Rptr. 14, 595 P.2d 592].) They draw our attention to section 1950.5, subdivision (k), which provides in pertinent part: "The bad faith claim or retention by a landlord ... of the security or any portion thereof, in violation of this section ..., may subject the landlord ... to statutory damages of up to six hundred dollars ($600), in addition to actual damages.... In any action under this section, the landlord ... shall have the burden of proof as to the reasonableness of the *747 amounts claimed...."[5] According to defendants, this provision is "critical" for two reasons. First, they argue that if the Legislature had intended to bar all claims for damages for unpaid rent, repair, and cleaning other than those made in accordance with section 1950.5, subdivision (f), it would not have been necessary to allocate the burden of proof regarding reasonableness, because the matter would never be litigated. According to defendants, this provision could only have meaning in cases in which the landlord has failed to comply with section 1950.5, subdivision (f), the tenant has sued for a refund, and the landlord seeks setoff. The argument misses the mark: the second sentence of section 1950.5, subdivision (k), would also apply in cases in which the tenant contests the accounting required under section 1950.5, subdivision (f), and sues for a refund of all or part of the amount deducted and retained under that provision.
Second, defendants contend that because the Legislature provided a remedy only for bad faith retention of a security deposit, we can infer it did not intend to impose a penalty for good faith retention. They conclude that landlords like themselves that have retained security deposits in good faith should not be penalized by being barred from raising setoff. This argument is persuasive. (4) "[I]t is well settled that `"Courts will not impose penalties for noncompliance with statutory provisions in addition to those that are provided expressly or by necessary implication."' [Citations.]" (People ex rel. Van de Kamp v. American Art Enterprises, Inc. (1983) 33 Cal.3d 328, 334 [188 Cal. Rptr. 740, 656 P.2d 1170].) (1d) Because the Legislature has not expressly stated that landlords that fail to comply with section 1950.5, subdivision (f), in good faith are barred from recovering for unpaid rent, repairs, and cleaning, we find that no such penalty was intended and we will not imply such a penalty.
Plaintiffs vigorously contend this result is inconsistent with principles of equity and with public policy. (See Prudential Reinsurance Co. v. Superior Court, supra, 3 Cal.4th 1118, 1139 [considering principles of equity and public policy in determining whether setoff was available].) They first urge that to allow landlords to raise setoff as a defense would be inconsistent with the equitable principle that an individual should not profit from his own wrong, because landlords may use this defense to keep all or part of the security deposits they retained in violation of section 1950.5, subdivision (f). While we recognize the importance of this equitable principle (see § 3517), and while we do not doubt that this principle may bar setoff on the particular facts of many individual cases, it does not justify an absolute bar to the right to a setoff in all cases.
*748 (5), (1e) When enacting, interpreting, or applying a rule of law that regulates the interaction between individual citizens, the lawmaking body should consider carefully before creating absolute and invariable rules. Normally, such laws should be as flexible as the regulated interactions are varied, and they should leave the courts with some discretion to apply them justly given the facts of the case before them. (See Heriot, A Study in the Choice of Form: Statutes of Limitation and the Doctrine of Laches, 1992 B.Y.U.L. Rev. 917, 920 ["In promulgating any kind of law, one of the tasks a lawmaker must perform is to select the best formulation of that law  the one that delegates to the law administrator the level of discretion and authority that is just right."].) Without some degree of flexibility, harsh and improper results may occur. (See id. at p. 937, fn. omitted [Comparing strict rules, like statutes of limitations, to more flexible standards, like the doctrine of laches, and asserting that as lawmakers move toward more rigid rules, "there is an increasing potential for incorrect judgments  judgments that would not reflect the lawmaker's preferences had the lawmaker adjudicated the case personally on an all-things-considered basis.... The rigidity of rules creates errors. [¶] ... [A] rulelike statute of limitations will always be both underinclusive and overinclusive.... [and therefore] [i]t will never be a perfect reflection of its underlying policies."].) Such flexibility is particularly appropriate when applying equitable doctrines, such as setoff. (See, e.g., Holmberg v. Armbrecht (1946) 327 U.S. 392, 396 [90 L.Ed. 743, 747, 66 S.Ct. 582, 162 A.L.R. 719] ["Equity eschews mechanical rules; it depends on flexibility."].)
In addition, a landlord that seeks setoff after good faith noncompliance with the procedures described in section 1950.5, subdivision (f), does not "profit from his own wrong," because he cannot set off any damages he could not have recovered if he had complied with section 1950.5, subdivision (f). Indeed the landlord suffers a great deal if he delays, because he loses the opportunity to take advantage of the summary nonjudicial procedure allowed under that statute, and must instead prove in court by a preponderance of the evidence that he is entitled to damages and that the amount claimed is reasonable. (§ 1950.5, subd. (k).) This burden of proof will become ever more difficult to sustain the longer the landlord delays, because the evidence supporting his claim may be lost with the passage of time.
Second, plaintiffs contend that to allow defendants to raise setoff would violate the equitable principle that an individual may not change his position to the detriment of another. (See § 3512.) They note defendants originally claimed (1) the excess payments were rent, (2) they had never demanded or received security deposits from plaintiffs, and (3) they, not plaintiffs, were to *749 bear the cost of unpaid rent, repairs, and cleaning. Only after the excess payments were found to be security deposits did defendants claim they were entitled to a setoff. Plaintiffs argue this change of position worked to their detriment because they did not receive adequate notice of defendants' claims. However, the original class notice contained the following paragraph: "Defendants contend that any refund you might be entitled to recover must be reduced by the amount of any unpaid rent, costs reasonably necessary to clean and repair damage you caused to the apartment, in excess of ordinary wear and tear, and that such sum could exceed the amount of any refund or damages you might receive." In light of this notice, plaintiffs' contentions regarding estoppel and lack of notice are unavailing.
Finally, plaintiffs contend that to allow setoff would be inappropriate in class actions such as this because of numerous practical difficulties. They stress that (1) the class is comprised of approximately 10,000 individuals, many of whom may have moved to other parts of the state or country, (2) defendants have raised between 6,200 and 8,000 claims for setoff, which must be litigated individually, (3) because the security deposits in question are between $100 and $150, a relatively small amount of money, many class members may not appear to oppose defendants' claims, and (4) if the class members do not appear, defendants will prevail by default on their claims for setoff, and may be unjustly enriched. Given these difficulties, plaintiffs ask us not only to bar defendants from raising setoff, but to reconsider our many earlier decisions holding setoff may be raised when the claims are not liquidated (see, e.g., Erlich v. Superior Court (1965) 63 Cal.2d 551, 555 [47 Cal. Rptr. 473, 407 P.2d 649]; Hauger v. Gates, supra, 42 Cal.2d 752, 755), at least in the context of class actions. We decline to do so for two reasons. First, it may well be possible on remand to shape a remedy that will avoid many of the problems plaintiffs have identified. Second, it is inappropriate to deprive defendants of their substantive rights merely because those rights are inconvenient in light of the litigation posture plaintiffs have chosen. (See City of San Jose v. Superior Court (1974) 12 Cal.3d 447, 462 [115 Cal. Rptr. 797, 525 P.2d 701, 76 A.L.R.3d 1223], fn. omitted ["Class actions are provided only as a means to enforce substantive law. Altering the substantive law to accommodate procedure would be to confuse the means with the ends  to sacrifice the goal for the going."].)
For the reasons stated, we conclude that a landlord who has failed in good faith to take advantage of the summary nonjudicial deduct-and-retain procedure allowed under section 1950.5, subdivision (f), may recover damages for unpaid rent, repairs and cleaning (§ 1950.5, subd. (e)) in a subsequent judicial proceeding provided that he proves by a preponderance of the evidence that he has suffered such damages and that the amount claimed is *750 reasonable (§ 1950.5, subd. (k)).[6] The trial court erred in ruling to the contrary, and that court must now hold an evidentiary hearing to determine whether defendants have sustained this burden. Because defendants have raised their claims through the equitable defense of setoff, the trial court must also determine whether defendants' claims are barred by any of the generally applicable equitable affirmative defenses, including laches, unclean hands, and estoppel.

II.
Plaintiffs requested that judgment be entered on behalf of the entire class for the aggregate amount of the security deposits retained, and suggested that any amounts not ultimately claimed by individual class members should escheat to the state. The trial court rejected the request and entered judgment in favor of only those members of the class (excluding the named plaintiffs, whose claims were dealt with separately) who might actually come forward and file individual claims. In doing so, the court issued a memorandum of intended decision stating in pertinent part: "In certain consumer class actions Fluid Recovery may be the best method of compensating the class. The propriety of Fluid Recovery in a particular case depends upon its usefulness in fulfilling the purposes of the underlying cause of action. (See State v. Levi Strauss & Co. [1986] 41 Cal.3d 460 [224 Cal. Rptr. 605, 715 P.2d 564].) We do not find that the Fluid Recovery method is necessary to fulfill the purposes of this case."[7] Plaintiffs now contend that the trial court abused its discretion by denying the remedy they requested.
(6) "The class action is a product of the court of equity  codified in section 382 of the Code of Civil Procedure. It rests on considerations of necessity and convenience, adopted to prevent a failure of justice." (City of San Jose v. Superior Court, supra, 12 Cal.3d 447, 458.) In 1994 the Legislature amended Code of Civil Procedure section 384, providing guidelines for the courts to use in exercising their equitable discretion to shape class remedies. Subdivision (b) of this statute declares that unless the defendant is a public entity or public employee, "prior to the entry of judgment in a class *751 action ... the court shall determine the total amount that will be payable to all class members, if all class members are paid the amount to which they are entitled pursuant to the judgment. The court shall also set a date when the parties shall report to the court the total amount that was actually paid to the class members. After the report is received, the court shall amend the judgment to direct the defendant to pay the sum of the unpaid residue, plus interest on that sum at the legal rate of interest from the date of the entry of the initial judgment, in any manner the court determines is consistent with the objectives and purposes of the underlying cause of action...." In subdivision (a) of Code of Civil Procedure section 384, the Legislature explains that its intent in enacting the foregoing statute was "to ensure that the unpaid residuals in class action litigation are distributed, to the extent possible, in a manner designed either to further the purposes of the underlying causes of action, or to promote justice for all Californians." However, the Legislature makes it clear that nothing in the statute "shall ... be construed to abrogate any equitable cy pres remedy which may be available in any class action with regard to all or part of the residue." (Id., subd. (d).)
When the trial court chose the class remedy in this case, it had already held that defendants were not entitled to set off amounts owed for unpaid rent, repair, and cleaning. There can be little doubt that this prior ruling was among the more important factors that the trial court considered in deciding what remedy would be most equitable given the circumstances as they then existed. However, we now hold in part I of this opinion that the trial court's initial ruling was error, that defendants are not barred as a matter of law from seeking setoff, and that they are entitled to have the opportunity to prove their right to setoff at an evidentiary hearing. It follows that the equities in this case may well have changed, and the trial court must reconsider its choice of remedy in light of the result of the forthcoming evidentiary hearing on defendants' claim of setoff.

III.
The judgment provided in part that "Plaintiffs shall recover legal costs in the amount of $ ____ [to be hereafter determined by the court]. Plaintiffs' counsel shall recover reasonable attorneys' fees in an amount to be hereafter determined by the Court. Such court costs and attorneys' fees shall be paid out of and deducted from any aggregate amount of money paid by Islay under this judgment as the refund of rent for the first 31 days of a tenancy (when compared with the rent for the second and subsequent months of the tenancy). Pursuant to the notice given potential class members, such court costs together with such attorneys' fees shall not exceed 25% of said aggregate amount."
*752 Plaintiffs contend the 25 percent limitation on attorney fees was an abuse of discretion because the court failed to obtain and consider evidence regarding the number of hours class counsel devoted to the litigation, counsel's normal hourly rates, counsel's experience, or the quality of the legal services provided. This contention is premature because it is impossible to determine whether attorney fees in the amount of 25 percent of the "aggregate class recovery" are adequate, given that (1) the amount of defendants' offsets, if any, have not yet been calculated, and it is therefore impossible to determine what the total class recovery will be, if anything, and (2) this case is far from over, and it is therefore impossible to determine the total number of hours class counsel will devote to it prior to completion.
(7) We have held, and we remain convinced, that an "`experienced trial judge is the best judge of the value of professional services rendered in his court....'" (Serrano v. Priest (1977) 20 Cal.3d 25, 49 [141 Cal. Rptr. 315, 569 P.2d 1303].) Accordingly, the trial court must reconsider the question of attorney fees after the forthcoming evidentiary hearing on defendants' claim of setoff.
The judgment of the Court of Appeal is reversed insofar as it impliedly affirms (1) that portion of the judgment of the trial court which limits recovery to nonnamed class members who have not opted out and who file claims, and (2) that portion of the judgment which limits the amount of the award of costs and attorney fees. The Court of Appeal shall remand the cause to the trial court with directions to conduct further proceedings consistent with this opinion. In all other respects the judgment of the Court of Appeal is affirmed.
Lucas, C.J., George, J., and Werdegar, J., concurred.
BAXTER, J.
I concur in the majority's judgment and in its holding that a landlord's good faith failure to comply with the requirement of Civil Code section 1950.5, subdivision (f) for an accounting and return of a former tenant's security deposit does not bar the landlord from raising setoff as a defense in an action by a former tenant for the refund. (All further section references are to the Civil Code.)
I respectfully disagree, though, with the majority's premise that section 1950.5 is ambiguous on the question of whether setoff is allowed and that we therefore must construe the statute based on its legislative history. "`If the language is clear and unambiguous there is no need for construction, nor is it necessary to resort to indicia of the intent of the Legislature....'" (Delaney v. Superior Court (1990) 50 Cal.3d 785, 798 [268 Cal. Rptr. 753, *753 789 P.2d 934], quoting Lungren v. Deukmejian (1988) 45 Cal.3d 727, 735 [248 Cal. Rptr. 115, 755 P.2d 299].) I believe section 1950.5 is not ambiguous and that we need not construe it. Section 1950.5, subdivision (k) provides the sole remedies for a landlord's retention of a security deposit: "The bad faith claim or retention by a landlord or the landlord's successors in interest of the security or any portion thereof in violation of this section, or the bad faith demand of replacement security in violation of subdivision (i), may subject the landlord or the landlord's successors in interest to statutory damages of up to six hundred dollars ($600), in addition to actual damages. The court may award damages for bad faith whenever the facts warrant such an award, regardless of whether the injured party has specifically requested relief. In any action under this section, the landlord or the landlord's successors in interest shall have the burden of proof as to the reasonableness of the amounts claimed or the authority pursuant to this section to demand additional security deposits." Nothing in the statute states or even suggests that the landlord who has acted in good faith loses his right to assert a setoff. Because section 1950.5 provides the remedies for a landlord's wrongful retention but does not even mention the loss of a landlord's setoff, the statute necessarily does not deprive the landlord of the setoff. This is not ambiguous.
Arabian, J., concurred.
KENNARD, J., Dissenting.
The law requires that a landlord "shall" assert any claims against the security deposit of a tenant within a short period (formerly two, now three weeks) after the tenancy ends and "shall" within that period refund to the tenant any portion of the security that the landlord did not claim. (Civil Code, § 1950.5, former subd. (e), now subd. (f), italics added.) In breach of this statutory duty, the defendant landlord here illegally withheld more than $1 million in security deposited by over 10,000 residential tenants without asserting any claim against the security. Nonetheless, in the name of "equity" the majority holds that the landlord may now, 14 to 17 years after the tenancies have ended, assert claims against the tenants' security for unpaid rent, cleaning expenses, and repair costs that the statute required the landlord to assert within 2 weeks of the end of each tenancy.
In its haste to embark on its meanderings along the byways of equity jurisprudence, the majority fails to recognize that the language and purpose of the statute preclude the result it reaches. The purpose of Civil Code section 1950.5's carefully calibrated provisions is to compel landlords to refund security due tenants promptly without the necessity of legal action by the tenants. To ensure that this occurs, the Legislature imposed the requirement that landlords make their claims against the security within the statutory period. The inescapable corollary of the landlord's mandatory duty to *754 assert any claims within the statutory period is that after that period expires the landlord loses any further right to assert claims as setoff against the security.
The majority, however, holds that landlords who violate Civil Code section 1950.5's requirement to set off and refund security within the statutory period may nonetheless later raise their claims as setoff against the security. I dissent because the majority's holding ignores the statutory language, disrupts the statutory scheme, and disserves the statute's purpose. Section 1950.5 will now become a toothless remedy.
Additionally, I would hold that the trial court abused its discretion in fashioning the class remedy. I agree with the majority, however, that the plaintiff class's objections to the attorney fee order are premature.

I
Plaintiffs Lisa Granberry et al. are a class of approximately 10,000 former tenants of defendants Islay Investments and its managing partner Marvin Trevillian (hereafter collectively the landlord). The class members were tenants of the landlord between 1978 and 1981. The landlord charged the tenants on average approximately $100 more for the first month of the tenancy than for each succeeding month of the tenancy.
Granberry filed this class action contending that the excess first month charge was a security payment within the meaning of Civil Code section 1950.5; the jury agreed. During the class period, class member tenants paid the landlord over $1 million in security in the form of excess first month charges, which the landlord never refunded or accounted for upon the termination of the tenancies.
The landlord filed a cross-complaint against the class member tenants for amounts allegedly due for unpaid rent, cleaning, and repairs. The trial court dismissed the landlord's cross-complaint because it was not properly served. The landlord also sought to assert these same claims as setoff to the security the landlord had received from the class member tenants. The trial court ruled that because the landlord had not complied with Civil Code section 1950.5, former subdivision (e)'s requirement of accounting for and refunding security within two weeks of the end of the tenancy, the landlord was not entitled to set off any claims against the security.
After trial, the court entered judgment. The judgment limited the landlord's liability to the amount of security owed to those class members who might thereafter submit a claim, rather than imposing liability for the full amount of the security withheld from the class as a whole.
*755 Reversing the trial court, the Court of Appeal held that the landlord was entitled to set off any claims against the security owed to the class member tenants. It also held that the trial court had not abused its discretion in fashioning a class remedy limiting the landlord's liability to only the security due to those class members who might thereafter submit a claim.

II
At the times relevant to this action, Civil Code section 1950.5, former subdivision (e) provided: "The landlord may claim of the security only such amounts as are reasonably necessary to remedy tenant defaults in the payment of rent, to repair damages to the premises caused by the tenant, exclusive of ordinary wear and tear, or to clean such premises, if necessary, upon termination of the tenancy. No later than two weeks after the tenant has vacated the premises, the landlord shall furnish the tenant with an itemized written statement of the basis for, and the amount of, any security received and the disposition of such security and shall return any remaining portion of such security to the tenant." (Civ. Code, § 1950.5, former subd. (e), italics added.)[1] This version of section 1950.5, subdivision (e), applicable during the period from 1978 to 1981 relevant to this action, was enacted in 1977. (Stats. 1977, ch. 971, § 2, p. 2939.) Thereafter, the Legislature amended section 1950.5 several times, extending the landlord's compliance period from two to three weeks and redesignating as subdivision (f) the second sentence of subdivision (e) containing the setoff-and-refund provision. Accordingly, I will hereafter refer to the setoff-and-refund provision as section 1950.5(f).
Section 1950.5 limits both the nature of the claims that a landlord may assert against the security and the time within which a landlord may assert those claims. Under the statute, within two weeks after a tenancy ends the landlord must assert any claims against the security and return any unclaimed amount.
The majority holds that, despite the landlord's statutory duty to assert any claim against the security and to refund the balance within two weeks of the end of the tenancy, a landlord who retains the entire security without complying with this duty may assert claims for the first time as setoff in a subsequent action by the tenant to recover the security. In my view, this holding is inconsistent with the language and purpose of section 1950.5(f).
In analyzing statutory language, this court looks to "the object to be achieved and the evil to be prevented by the legislation." (Harris v. Capital *756 Growth Investors XIV (1991) 52 Cal.3d 1142, 1159 [278 Cal. Rptr. 614, 805 P.2d 873].) As the majority acknowledges, section 1950.5(f) was designed to address the evil of landlords who fail to promptly return security due the tenant at the end of the tenancy. (Maj. opn., ante, at p. 746.) Recognizing the obstacles facing a former tenant seeking to recover a security deposit from a recalcitrant landlord and the former tenant's lack of leverage over the landlord, the Legislature sought to level the playing field by in effect telling the landlord holding the security to "claim it or lose it."
The plain language of section 1950.5(f) requires a landlord within two weeks of the end of a tenancy to notify the tenant of any claims against the security and to return any portion of the security upon which the landlord has no claim. By strictly limiting the time within which a landlord can assert a claim against the security, the Legislature has necessarily provided that the landlord forfeits any right to set off claims against the security if the landlord does not do so within the statutory period.
This reading of section 1950.5(f) accords with its purpose. Section 1950.5(f) was designed to compel landlords to routinely return security due the tenant without the necessity of legal action. In the words of the majority, section 1950.5(f) "was enacted to ensure the speedy return of security deposits on the termination of tenancy and to prevent the improper retention of such deposits." (Maj. opn., ante, at p. 746.) This purpose is furthered by requiring landlords to assert their claims against the security promptly after the end of the tenancy or else lose the right to do so thereafter.
Although a landlord loses all recourse against the security by failing to assert any claims within the statutory two-week period, this does not mean that the landlord has lost all recourse against the tenant. Nothing in section 1950.5(f) suggests that, by losing the right to set off claims against the security, the landlord has also forfeited any causes of action against the tenant. A landlord wishing to pursue those claims after allowing the statutory period to elapse may do so in an independent suit against the tenant. The landlord in this case did file a cross-complaint against the class members asserting claims for unpaid rent, cleaning costs, and repair costs; the cross-complaint was dismissed, however, when the landlord failed to properly serve it.

III
The majority hinges its conclusion that a landlord does not lose the right of setoff after the statutory period expires on the following reasoning. It first contends that to deny a continuing right of setoff to the landlord who fails to *757 assert claims within the statutory period would impose a "penalty" on the landlord. It then contends that, because section 1950.5, subdivision (k) (hereafter section 1950.5(k)) authorizes $600 in statutory damages to be awarded against a landlord who in bad faith unlawfully retains security, the Legislature did not intend to "penalize" landlords who without bad faith unlawfully retain security by denying them the right of setoff.[2] I disagree both with the majority's characterization of the limitations period of the landlord's setoff right as a "penalty" and with its conclusion that the bad-faith-damages provision of section 1950.5(k) demonstrates an implicit intention by the Legislature not to terminate the landlord's right of setoff after the landlord has failed to assert any claims within the statutory period.
The majority is wrong in characterizing the expiration of the section 1950.5(f) limitations period as a "penalty." We do not commonly say that someone who has forfeited a claim by failing to bring it within the statute of limitations period has suffered a penalty. Under the majority's reasoning, however, every statute of limitations would be a penalty.
Nor is a limitations period for asserting claims (such as the limitation period of section 1950.5(f)) a "penalty" in the sense in which that word was used in the case on which the majority relies, People ex rel. Van de Kamp v. American Art Enterprises, Inc. (1983) 33 Cal.3d 328, 334 [188 Cal. Rptr. 740, 656 P.2d 1170]. At issue there was a monetary fine, not a claims limitation period as is the case here. (See ibid.)
Furthermore, even if the complete loss of a claim resulting from the running of a limitations period could properly be characterized as a penalty, it would still be incorrect to characterize the expiration of the landlord's setoff right under section 1950.5(f) as a penalty. As explained above, the landlord whose setoff right under section 1950.5(f) lapses does not forfeit any claims against the tenant, which the landlord can still pursue in an independent action against the tenant, but only loses the right to satisfy the claims out of the security.
Even assuming that the expiration of the landlord's right to setoff could be characterized as a penalty, it is one that arises "`"by necessary implication"'" (People ex rel. Van de Kamp v. American Art Enterprises, Inc., supra, 33 Cal.3d at p. 334) from the language of section 1950.5(f). As described above, the Legislature's imposition on landlords of a mandatory duty to assert any claims against the security within two weeks of the end of the tenancy necessarily implies that if landlords fail to do so within that *758 period, they cannot do so later. To hold otherwise would render meaningless the mandatory term "shall" that the Legislature used in section 1950.5(f).
The majority is also wrong in concluding that, because section 1950.5(k) authorizes statutory damages for landlords who retain security in bad faith, the Legislature must have intended that landlords who, without acting in bad faith, unlawfully breach their mandatory duty to account for any claims against the security and to refund any remaining security should not lose the right of setoff after the statutory period expires. Section 1950.5(k) provides: "The bad faith claim or retention by a landlord ... of the security or any portion thereof in violation of this section, ... may subject the landlord ... to statutory damages of up to six hundred dollars ($600), in addition to actual damages."
The Legislature's decision to impose a special consequence  statutory damages  for retention of security that is accompanied by bad faith raises no logical inference that the Legislature intended to impose no consequence whatever for retention of security in violation of section 1950.5(f) not accompanied by bad faith. There is nothing logically inconsistent about imposing separate consequences for these different types of conduct. To the contrary, in light of the legislative purpose  to secure the prompt return of tenant funds to which the landlord has no legitimate claim  it is perfectly rational and consistent for the Legislature to have imposed, as it did, loss of setoff as the basic consequence for all retention of security beyond the statutory period, and to have imposed statutory damages as a second and additional consequence for a particularly aggravated form of statutory violation consisting of improper retention of security accompanied by bad faith.
Nor, unlike People ex rel. Van de Kamp v. American Art Enterprises, Inc., supra, 33 Cal.3d 328, 334, on which the majority relies, is this a case in which, because the Legislature has provided certain penalties or consequences for a statutory violation, the issue is whether the Legislature intended those remedies to exclude other penalties or consequences. American Art was a nuisance action in which the trial court had imposed upon the defendants a $168,000 fine not expressly authorized by the nuisance statute. (Id. at p. 334.) Because the Legislature had expressly authorized injunctive relief and the sale of the offending property as remedies for a nuisance, it was unlikely that the Legislature had impliedly authorized monetary fines as an additional punishment for the same act. Here, however, in the majority's view the Legislature has provided no consequence for a violation of the mandatory setoff-and-refund requirement not accompanied by bad faith.
By permitting a landlord who has retained the entire security without timely asserting any claims to the tenant to nonetheless set off claims in an *759 action by the tenant to recover the security, the majority's holding will render section 1950.5(f) a flimsy barrier against the evil it is designed to address  landlords who do not promptly account for any claims against the security and refund whatever security is due their tenants without the necessity of legal action by the tenant. The statutory requirements that the landlord "shall" assert claims against the security within two weeks by notifying the tenant and "shall" refund any remaining portion within two weeks are meaningless, and the purpose of the statute is frustrated, if the landlord who fails to do so can nonetheless assert those claims as setoff years later in an action by the tenant to recover the security. The carefully balanced incentives of section 1950.5, designed to ensure that landlords refund security routinely and without the necessity of court action, will accordingly be defeated.

IV
The trial court's class action judgment required the landlord to refund only the security withheld from those class member tenants who might thereafter submit a claim against the landlord. The majority reverses the portion of the Court of Appeal's judgment affirming the trial court's class action remedy without reaching the issue of whether the trial court abused its discretion in fashioning that remedy. In order to provide guidance to the trial court on remand, I would reach that issue and hold that the trial court abused its discretion in ordering a class remedy that permits the landlord to retain class damages that are not claimed by individual class members.
The trial court's decision to limit the landlord's liability to only the amounts owed to those class members who may come forward and submit individual claims, rather than imposing liability for the full amount of unlawfully withheld security owed to the class as a whole, was an abuse of discretion, even assuming that the landlord should be permitted the right of setoff. In my view, allowing a wrongdoing defendant to retain all or part of the amount for which it is liable to the plaintiff class rarely is one of the options that a court should choose in deciding how to distribute the class recovery or dispose of the residual.
Initially, the trial court failed to distinguish between the separate issues of the determination of the amount for which a defendant is liable to the plaintiff class and the method for distribution of that amount to the class. Code of Civil Procedure section 384, cited by the majority, makes clear the distinction between the amount of a defendant's liability to the class and the method of distribution of the class recovery (including the disposition of any unpaid residual). It first requires that "prior to the entry of any judgment in *760 a class action ... the court shall determine the total amount that will be payable to all class members...." (Code Civ. Proc., § 384, subd. (b), italics added.) Thereafter, "the parties shall report to the court the total amount that was actually paid to the class members. After the report is received, the court shall amend the judgment to direct the defendant to pay the sum of the unpaid residue ... in any manner the court determines is consistent with the objectives and purposes of the underlying cause of action...." (Ibid.) Thus, the proper measure of the class recovery is the injury caused to the class members, not the amounts that individual class members step forward to claim.
The trial court erased the distinction between these two concepts by making the amount of the class recovery turn on the effectiveness of the distribution method it selected. Using the trial court's formula, by definition there would never be any unpaid residuals in class actions because defendants would never have any liability for any amounts not claimed by class members. By making the landlord liable only for the security withheld from those class members who step forward to claim a refund and not for the security withheld from the class as a whole, the trial court in effect narrowed the class without notice after the trial had concluded and extinguished the causes of action of the nonclaiming class members. Instead, the trial court should have first determined the landlord's total liability to the class as a whole and then developed a method for distributing that amount to the class members to the extent feasible and for dealing with any unclaimed residual.
A trial court has several sources of guidance in dealing with the unclaimed residual of a class recovery. As the majority acknowledges, the class action is a creature of equity, and it is a first principle of equity that a wrongdoer should not be permitted to profit from its wrongs. (See § 3517 ["No one can take advantage of his own wrong."]; see also Shepherd, Damage Distribution in Class Actions: The Cy Pres Remedy (1972) 39 U.Chi. L.Rev. 448 [retention of unclaimed residue by the defendant results in "unjust enrichment of the defendant"].) Consequently, this court has previously held that the various methods of distributing the unpaid residual of a class recovery that go under the name of "fluid recovery" may be "essential to ensure that the policies of disgorgement or deterrence are realized" and should be utilized where appropriate to "fulfill[] the purposes of the underlying cause of action." (State of California v. Levi Strauss & Co. (1986) 41 Cal.3d 460, 472 [224 Cal. Rptr. 605, 715 P.2d 564].)
The Legislature, in Code of Civil Procedure section 384, has expressly addressed the factors a trial court must consider in crafting a method for the disposition of the unclaimed residual of a class recovery. It has decided that "unpaid residuals in class action litigation [should be] distributed, to the *761 extent possible, in a manner designed either to further the purposes of the underlying causes of action, or to promote justice for all Californians," including distribution to child advocacy programs or to the California Legal Corps. (Code Civ. Proc., § 384, subd. (a).) Rarely will it further the purposes of the underlying action or promote justice to permit a wrongdoing defendant in a class action to simply retain for its own benefit the unpaid residual of the class recovery, and nothing in Code of Civil Procedure section 384 contemplates such a result.
Accordingly, the trial court abused its discretion when it permitted the landlord to retain the unclaimed residual of the class recovery for the landlord's own benefit. The trial court in this case made no findings and gave no reasons to support its conclusion that the landlord should be permitted to retain the unpaid residual or that would explain why it was fair and just for the landlord to do so. Instead, the trial court simply made the conclusory assertion that "[w]e do not find that the Fluid Recovery method is necessary to fulfill the purpose of this case." Given that it ordinarily does not further the purposes of the underlying action or promote justice to permit a defendant to retain the unpaid residual in a class action, the trial court's unexplained decision to the contrary was an abuse of discretion. This is especially so because the landlord here had previously attempted to evade section 1950.5's predecessor statute and to unlawfully retain security due its tenants by denominating the security a "nonrefundable cleaning fee." (See Bauman v. Islay Investments (1973) 30 Cal. App.3d 752 [106 Cal. Rptr. 889].)

CONCLUSION
The Legislature enacted section 1950.5 to protect tenants, not landlords. Section 1950.5(f) sets a clear limit on the landlord's right to set off claims against the security by requiring a landlord to assert any claims against the security within two weeks of the end of the tenancy and then refund the balance. This furthers section 1950.5's purpose of ensuring that landlords routinely refund security due their tenants without the necessity of legal action by their tenants.
Repeatedly invoking its notion of equity, however, the majority ignores the language and purpose of section 1950.5(f) to hold that landlords do not lose their right of setoff after the expiration of the statutory period. I cannot agree with this attempt to rewrite section 1950.5(f) and eviscerate its purpose.
Moreover, the Legislature intended that those tenants who are forced to bring a lawsuit to recover their security have a simple, swift, and certain legal remedy: section 1950.5 expressly authorizes actions brought under that section to be maintained in small claims court, limits the types of claims that *762 can be asserted against the security, and puts on the landlord the burden of proof as to the reasonableness of any amount claimed against the security. (§ 1950.5, subds. (e), (k), (m).) In turn, section 1950.5(f), by cutting off the landlord's right of setoff after the two-week statutory period, assures the tenant weighing whether to bring an action to recover security that he or she will not be met by a surprise claim of setoff never before raised by the landlord.
The majority's holding upsets this statutory scheme, for a tenant who brings an action to recover security now may be faced with unanticipated claims of setoff the landlord has never before asserted. The tenant's action is made not only unpredictable but more complicated. Undoubtedly, in light of the majority's creation of a landlord's right to setoff in actions to recover security, many tenants will now conclude that it is not worth the effort to bring such an action, just as they did before section 1950.5  hardly the result the Legislature intended in enacting this consumer protection statute.
For the foregoing reasons, I would reverse the portion of the judgment of the Court of Appeal holding that the landlord may set off its claims against the illegally withheld security and the portion of the judgment holding that the trial court did not abuse its discretion in limiting the landlord's liability to only the security due those class members who hereafter submit a claim.
The petition of plaintiffs and appellants for a rehearing was denied April 20, 1995. Kennard, J., was of the opinion that the petition should be granted.
NOTES
[1]  At the time of the events in this case the statute allowed landlords only two weeks to act and the subdivision so providing was designated subdivision (e). The amendment changing the statute into its present form took effect on January 1, 1994. (Stats. 1993, ch. 755, § 1.) The amendment is not material to the issues presented by this case.

All further statutory references are to the Civil Code unless otherwise specified.
[2]  The first month's rent exceeded the rent paid in subsequent months by approximately $100. (Granberry v. Islay Investments (1984) 161 Cal. App.3d 382, 385, fn. 4 [207 Cal. Rptr. 652].)
[3]  Section 1950.5, subdivision (b) provides:

"As used in this section, `security' means any payment, fee, deposit or charge, including, but not limited to, an advance payment of rent, used or to be used for any purpose, including, but not limited to, any of the following:
"(1) The compensation of a landlord for a tenant's default in the payment of rent.
"(2) The repair of damages to the premises, exclusive of ordinary wear and tear, caused by the tenant or by a guest or licensee of the tenant.
"(3) The cleaning of the premises upon termination of the tenancy.
"(4) To remedy future defaults by the tenant in any obligation under the rental agreement to restore, replace or return personal property or appurtenances, exclusive of ordinary wear and tear, if the security deposit is authorized to be applied thereto by the rental agreement."
[4]  The Court of Appeal also held that the trial court erred in failing to award prejudgment interest to plaintiffs and that the jury instruction defining the words "bad faith" was not erroneous. Because these holdings were not addressed in the petition for review, we need not discuss them further. (Cal. Rules of Court, rule 29.3(c).)
[5]  Prior to the 1993 amendments (see fn. 1, ante) this subdivision was designated subdivision (h), and the penalty for bad faith was $200 rather than $600.
[6]  Because the jury did not find that defendants here acted in bad faith, we do not consider and therefore express no opinion regarding the rights of landlords who have acted in bad faith.
[7]  The term "fluid recovery" refers to the application of the equitable doctrine of cy pres in the context of a modern class action. (State of California v. Levi Strauss & Co. (1986) 41 Cal.3d 460, 472 [224 Cal. Rptr. 605, 715 P.2d 564].) "The implementation of fluid recovery involves three steps. [Citation.] First, the defendant's total damage liability is paid over to a class fund. Second, individual class members are afforded an opportunity to collect their individual shares by proving their particular damages, usually according to a lowered standard of proof. Third, any residue remaining after individual claims have been paid is distributed by one of several practical procedures that have been developed by the courts." (Id. at pp. 472-473.)
[1]  Unless otherwise noted, all further statutory references are to the Civil Code.
[2]  The amount of statutory damages available under section 1950.5 during the period relevant to this lawsuit was $200. (§ 1950.5, former subd. (h).)
