
889 P.2d 105 (1995)
126 Idaho 671
Donald WRIGHT and Aloma Wright, husband and wife, Plaintiffs-Respondents,
v.
James BRADY and Rebecca Brady, husband and wife, Defendants-Appellants.
No. 21086.
Court of Appeals of Idaho.
February 2, 1995.
Idaho Legal Aid Services, Inc., Idaho Falls, for appellants.
Anderson, Nelson & Hall, Idaho Falls, for respondents.
*106 PERRY, Judge.
In this case we are asked to decide whether retaliatory eviction may be asserted by a tenant as an affirmative defense in an unlawful detainer action brought by a landlord. We conclude that such a defense may be raised by a tenant in Idaho, and we therefore reverse the magistrate's order granting summary judgment to the landlord.

FACTS AND PROCEDURE
In June of 1991, James and Rebecca Brady (the Bradys) rented certain residential premises in Idaho Falls through a written month-to-month agreement. The premises were owned by Donald and Aloma Wright (the Wrights). In June of 1992, the Bradys made oral requests for repairs to the premises and then sent a written notice, pursuant to I.C. § 6-320, demanding that certain repairs be made. The nature of the requested repairs included: repair of plumbing in the kitchen and bathroom, repairing a defective refrigerator and a defective stove, replacing a broken front door lock and waterproofing the basement.
In July of 1992, the Bradys employed an attorney who sent a second demand letter to the Wrights. By September, the repairs still had not been performed. The Bradys then registered a complaint with the City of Idaho Falls. An Idaho Falls city building inspector visited the residence and found eight violations of the Uniform Housing Code, which had been adopted in 1977 by the City of Idaho Falls. The inspector sent a letter to the Wrights demanding that the violations be remedied and warning that the city would take steps necessary to enforce compliance.
On September 22, 1992, the Wrights sent a thirty-day Notice of Termination of Lease to the Bradys. Both parties filed complaints in the magistrate division, the Wrights for unlawful detainer pursuant to I.C. § 6-301 through § 6-316, and the Bradys for an order requiring specific performance of the repairs pursuant to I.C. § 6-320. The magistrate granted the Bradys' request for specific performance on November 19, 1992. The magistrate's order included those items which the Bradys had requested be repaired *107 in their initial letter, as well as a number of other items found to be in need of repair.
The Wrights filed a motion for summary judgment on their complaint in the unlawful detainer action. Following a hearing, the magistrate granted the Wrights' motion for summary judgment on January 21, 1993, ordering immediate vacation of the premises by the Bradys. In its order granting summary judgment, the magistrate found that "the legislative intent and public policy in Idaho does not generally imply the right of a tenant to be protected from a retaliatory eviction by a landlord."
The Bradys appealed to the district court, which affirmed the decision of the magistrate. The Bradys now appeal to this Court, asserting as their only issue whether Idaho recognizes retaliatory eviction as an affirmative defense to an unlawful detainer action.

ANALYSIS
We first note that, when reviewing a case decided in the magistrate division that has been appealed to the district court, we review the magistrate's decision independently of, but with due regard for, the district court's intermediate appellate decision. Ireland v. Ireland, 123 Idaho 955, 957-58, 855 P.2d 40, 42-43 (1993); Hentges v. Hentges, 115 Idaho 192, 194, 765 P.2d 1094, 1096 (Ct.App.1988).
On appeal from an order granting summary judgment, we exercise free review in determining whether a genuine issue of material fact exists and whether the moving party is entitled to judgment as a matter of law. Edwards v. Conchemco, Inc., 111 Idaho 851, 852, 727 P.2d 1279, 1280 (Ct.App.1986). When assessing a motion for summary judgment, all controverted facts are to be liberally construed in favor of the nonmoving party. G & M Farms v. Funk Irrigation Co., 119 Idaho 514, 517, 808 P.2d 851, 854 (1991); Sanders v. Kuna Joint School Dist., 125 Idaho 872, 876 P.2d 154 (Ct.App.1994). In this case the summary judgment was granted because the magistrate determined that, even assuming the Bradys' factual claims of retaliatory eviction were correct, they had stated no cognizable defense based on Idaho law. Thus, we must determine whether an affirmative defense of retaliatory eviction is available to a tenant under Idaho law. We conclude that it is, and we reverse the magistrate's order and judgment.
The defining case for the affirmative defense of retaliatory eviction is Edwards v. Habib, 397 F.2d 687 (D.C.Cir.1968). In Edwards, the Court of Appeals encountered what would become a common factual circumstance. After moving into an apartment in an area plagued by housing shortages, a tenant reported housing code violations to the appropriate governmental authority. Shortly after the landlord was ordered to remedy the violations, he sent a notice to the tenant terminating the month-to-month tenancy. When the tenant refused to vacate the premises, the landlord initiated statutory procedures for eviction of the tenant.
Although the court in Edwards considered various constitutional rationales for the retaliatory eviction defense, its decision was ultimately based upon legislative intent. The court found:
The notion that the effectiveness of remedial legislation will be inhibited if those reporting violations of it can legally be intimidated is so fundamental that a presumption against the legality of such intimidation can be inferred as inherent in the legislation even if it is not expressed in the statute itself.
Edwards, 397 F.2d at 701-02.
Since the decision in Edwards, a great number of states have adopted the retaliatory eviction defense, usually by statute. See e.g. Cal.Civ.Code § 1942.5; Mont.Code § 70-24-431; Or.Rev.Stat. § 90.385; Wash.Rev. Code § 59.18.240. See generally statutes cited in RESTATEMENT (SECOND) OF PROPERTY § 14.8 (1977)
The Idaho Legislature, when adopting the Mobile Home Park Landlord-Tenant Act in 1980, prohibited retaliatory eviction of tenants of mobile home parks. Idaho Code Section 55-2015 states:
Retaliatory conduct by landlord prohibited.  The landlord shall not terminate a tenancy, refuse to renew a tenancy, increase rent or decrease services he normally supplies, or threaten to bring an action for repossession of a mobile home lot as retaliation against the tenant because the tenant has:

*108 (a) Complained in good faith about a violation of a building, safety or health code or regulation pertaining to a mobile home park to the governmental agency responsible for enforcing the code or regulation.
(b) Complained to the landlord concerning the maintenance or condition of the park, rent charged or rules and regulations.
(c) Organized, became a member of or served as an official in a homeowner's association, or similar organization, at a local, regional, state or national level.
(d) Retained counsel or an agent to represent his interests.
This statute is similar in form to section 5.101 of the Uniform Residential Landlord and Tenant Act, 7B U.L.A. 503 (1994), and to statutes in other states that allow retaliatory eviction as an affirmative defense. See e.g. Ariz.Rev.Stat.Ann. § 33-1381; Nev.Rev.Stat. § 118A.510.
The magistrate, in considering the provisions of I.C. § 55-2015, relied on the maxim expressio unius est exclusio alterius, or the expression of one thing excludes another. The magistrate reasoned that in enacting I.C. § 55-2015 without amending other landlord-tenant statutes, the legislature intended that no similar protection be afforded to nonmobile home tenants. With respect to using expressio unius est exclusio alterius as an interpretive doctrine, however, the Idaho Supreme Court has stated:
Such doctrine is not an unimpeachable rule of law, but merely a logical statement that the court, in cases consistent with recognized rules of interpretation, will adhere to the literal language of a statute in determining the legislative intent. The applicability of the doctrine to any particular statute depends upon whether the legislative intent appears in clear terms in the statute. If not, the intention is to be "collected from the context, from the occasion and necessity of the law, from the mischief felt, and the remedy in view; and the intention is to be taken or presumed according to what is consonant with reason and good discretion."
Noble v. Glenns Ferry Bank, Ltd., 91 Idaho 364, 367, 421 P.2d 444, 447 (1966) (citations omitted). See also Hewson v. Asker's Thrift Shop, 120 Idaho 164, 814 P.2d 424 (1991); Union Pacific Railroad Co. v. Board of Tax Appeals, 103 Idaho 808, 654 P.2d 901 (1982). The maxim is generally applied when a statute lists one or more of a number of possible subjects, the inference being that unlisted items were not intended to fall within the statute's purview.
In this case, however, we believe the enactment of I.C. § 55-2015 indicates legislative intent to provide protection to a tenant who seeks enforcement of housing laws. In 1980, I.C. § 55-2015 was adopted as part of a comprehensive act regulating mobile home tenancies. The Idaho Code sections that generally deal with landlord-tenant relationships, primarily I.C. § 6-301 et seq., have not undergone substantial legislative revision since the mid-1970's. See 1977 Idaho Sess. Laws 80; 1974 Idaho Sess. Laws 1803. Until adoption of the Mobile Home Act, the legislature had not previously provided tenants with retaliatory eviction as an affirmative defense. The legislature's failure to amend unrelated code sections does not necessarily imply its intent to exclude the principles contained in the new legislation from application elsewhere within the code. There does not appear to be any rational or comprehensible reason why the legislature would seek to further the enforcement of building and safety codes for mobile home park residents but not for other similarly situated tenants.
However, we need not look only to the language of a statute to ascertain the legislature's intent, but we may also consider policy matters and general reasonableness. Summers v. Dooley, 94 Idaho 87, 481 P.2d 318 (1971). Our analysis of the policy and reasonableness behind the Idaho Legislature's enactment of statutes like I.C. § 6-320, and of the various cities adopting building and housing codes, leads us to conclude that those legislative bodies intend for their enactments to be uniformly enforced. The purpose of the Uniform Housing Code, as adopted in the Idaho Falls City Code, is to "provide minimum standards to safeguard life and limb, health, property and public welfare...." This purpose is seriously frustrated if a tenant may be evicted in retaliation for reporting or complaining to the proper authorities about housing code violations. *109 Landlords who refuse to abide by the legislated housing codes should not be able to avoid compliance by intimidating tenants with the threat of eviction, thereby maintaining dangerous housing units.
We therefore hold that a landlord's claim for eviction of a tenant may be defeated by a showing that the primary motive for the eviction is retaliation against the tenant for reporting to authorities violations of housing or safety codes. The tenant will carry the burden to prove the retaliatory nature of the eviction.
The magistrate erred in granting the Wrights' motion for summary judgment on the ground that retaliatory eviction as an affirmative defense was unavailable to the Bradys. We reverse the order granting summary judgment and we remand the case for further proceedings. Costs on appeal, but not attorney fees, are awarded to the appellants.
WALTERS, C.J., and LANSING, J., concur.
