The Commonwealth’s lodging house licensing statutory system — G. L. c. 140, §§ 22-32 (Act) — is at the center of this consolidated appeal. Five property owners (defendants) appeal from judgments of the Housing Court permanently *758enjoining them “from allowing more than three unrelated adults to reside in each legal dwelling unit” in question, and from final orders adjudging them in contempt for disobeying court orders so enjoining them. General Laws c. 140, § 22, amended by St. 1973, c. 481, defines a lodging house as “a house where lodgings are let to four or more persons not within the second degree of kindred to the person conducting” such a facility.
On appeal, the defendants argue the order for injunctive relief was erroneous as matter of law and must be vacated. They contend each unit was rented to four unrelated adult college students, living as a “family” or single housekeeping unit, an arrangement which, the defendants say, does not constitute a lodging house under the Act. We affirm.
1. Background. The facts, which are not in dispute, are as follows. The defendants own multiunit rental properties in the city of Worcester (city). Paul F. Giorgio and Diana H. Giorgio own such properties at 7 Clay Street and 13 Boyden Street. College Hill Properties, LLC, an entity controlled by Paul F. Giorgio, owns a property located at 11 Boyden Street. Michele Meaney and Paul J. Meaney own properties at 21 and 23 Caro Street.
Upon an investigation by its department of inspectional services, the city served the defendants with written notices, citing them for operating unlicensed lodging houses at the stated locations. The city ordered the defendants to cease and desist from doing so; the defendants refused.
As authorized by G. L. c. 140, § 24,3 the city commenced civil actions against the defendants to enforce its administrative orders and made application to a Housing Court judge for the issuance of preliminary injunctions restraining the defendants from conducting unlicensed lodging houses.4 See Mass.R.Civ.P. 65(b)(1), 365 Mass. 832 (1974).
The city presented evidence showing that at each property *759address, the defendants rented a unit to four unrelated adults, all of whom were students at a local college. Each unit had a living and dining room, kitchen, bathroom, and bedrooms (the number of which was left undefined). Counsel for the defendants represented to the judge that the students signed a lease for a twelve-month period; no lease was offered to the judge.
After a hearing in each case, the judge granted the city’s application and issued an injunction commanding the defendants to “forthwith reduce the number of unrelated adult occupants” in the subject premises “to no more than three in each legal dwelling unit.”5 There the cases stood until the city filed civil contempt complaints against the defendants for disobeying the injunction. See Mass.R.Civ.P. 65.3, as appearing in 386 Mass. 1244 (1982).
Show-cause hearings ensued. The judge found the defendants in contempt and imposed fines,6 memorialized in the judge’s orders of contempt. Final judgments entered permanently enjoining the defendants “from allowing more than three unrelated adults to reside in each dwelling unit.” The actions were later consolidated for purposes of this appeal.
2. Standard of review. Action by a licensing body in furtherance of the Act is appraised by the substantial evidence test. See G. L. c. 140, § 30; Trustees of Paul Revere Realty Trust v. Revere License Commn., 29 Mass. App. Ct. 11, 12 n.3 (1990). This case reduces to a question of law as to the meaning of “lodging house” under the Act, an issue that is subject to de novo review. See Massachusetts Insurers Insolvency Fund v. Smith, 458 Mass. 561, 564-565 (2010); Commonwealth v. B & M Fitzgerald Builders, Inc., 71 Mass. App. Ct. 486, 491 (2008); Gore v. Arbella Mut. Ins. Co., 77 Mass. App. Ct. 518, 536 (2010).
“[W]e interpret the words used in a statute with regard to both their literal meaning and the purpose and history of the *760statute within which they appear.” Atlanticare Med. Center v. Commissioner of the Div. of Med. Assistance, 439 Mass. 1, 6 (2003), quoting from Massachusetts Hosp. Assn. v. Department of Med. Sec., 412 Mass. 340, 346 (1992). We concur with the judge that under the Act, “lodging house” encompassed the arrangements the defendants had obtained with the students, resulting in violations of the law.
3. Discussion, a. Lodging house. The Legislature’s licensing system for regulating lodging houses in the Commonwealth was enacted during World War I. St. 1918, c. 259. It was designed to address the Legislature’s concerns with the deplorable health and sanitary conditions then prevailing in lodging houses and their notorious use as a venue for immoral solicitation and other like conduct. See Maher v. Brookline, 339 Mass. 209, 215 (1959); Newbury Jr. College v. Brookline, 19 Mass. App. Ct. 197, 203-204 (1985). “It is unquestioned that the Legislature has inherent authority to regulate buildings, structures and premises in the interests of public safety, health, morals and welfare.” Inspector of Bldgs. of Falmouth v. General Outdoor Advertising Co., 264 Mass. 85, 87 (1928).
The policies generally advanced by the Act still hold today with respect to the common practice of overcrowding persons in an unsuitable space, whether in lodging houses or tenements. Tenant overcrowding and fire protection were among the reasons the city cited for its enforcement actions. To obtain a lodging house license, an applicant must have sprinkler systems in the premises. The defendants do not claim to have sprinklers in their units.7 See Massachusetts Sober Hous. Corp. v. Automatic Sprinkler Appeals Bd., 66 Mass. App. Ct. 701, 704-705 (2006).
Because safety, health, and welfare concerns stemming from lodging houses have more to do with management than with *761zoning issues, licensure is an effective regulatory device to bring about desired legislative ends.8 “Licensing serves a triggering function, to alert local authorities that they should monitor conditions in the licensed premises.” Newbury Jr. College, supra at 205.
With this backdrop, we look to the words of the Act itself.9 Lodging house is “a house[10] where lodgings[11] are let[12] to four or more persons not within second degree of kindred to the person conducting it.”13 G. L. c. 140, § 22. The city’s proof established each such element for each of the properties at issue here: a building or structure, where housing accommodations are leased or let, to four adults, unrelated to the defendants.
As they did before the judge, the defendants contend that their properties are not governed by § 22 because each unit was occupied by four or more unrelated adult tenants, “living as a family unit,” not lodgers.14 This argument was also advanced in *762Worcester v. Bonaventura, 56 Mass. App. Ct. 166 (2002), and this court rejected it.
Bonaventura, which is virtually identical to the present appeal, involved enforcement actions by the city against owners who had rented condominium units to four unrelated adults, all of whom were students at a local college. Each student had signed a lease, was jointly responsible for the rent, and had full use of the unit. Id. at 167. There, as here, the defendants had argued the students were tenants whose living arrangements formed a single housekeeping unit, akin to a family, within the meaning of a local zoning ordinance.15 That argument was unpersuasive. We held that the question whether the owners were operating a lodging house did not “turn on the status of the student occupants as tenants,” but that it was a legal issue for the court to answer by interpreting the terms of the local zoning ordinance “in the context of the [ordinance] as a whole and, to the extent consistent with common sense and practicality, [giving them] their ordinary meaning.”16 Id. at 168. The same is true here, except the Act, not a local ordinance, is at issue.
*763The Act, we believe, covers such an ad hoc group housing arrangement, among four or more persons, whose composition is not a family or single housekeeping unit, and which is not otherwise licensed or regulated by State agencies. Though the line between a lodging house, single housekeeping unit, and group home may not always be easy to discern, see Hall v. Zoning Bd. of Appeals of Edgartown, 28 Mass. App. Ct. 249, 256 n.9 (1990), we have no doubt that four or more unrelated adults, sharing housing while attending college, is not an arrangement that lends itself to the formation of a stable and durable household.
It is enough to say that the city, in its licensing capacity, reasonably exercised its supervisory and enforcement powers to remedy an unsafe and illegal condition existing in the subject properties. To narrow the definition of lodging house, as the defendants ask us to do, would undermine the Act’s purposes: to assure such facilities are safe, sanitary, habitable, and orderly. And, to do so, absent a mandate from the Legislature, would likely offer a blueprint for property owners to circumvent this long-standing licensing system.17
The judge properly issued the injunctive relief enforcing the city’s administrative order based on the city’s proving all of the statutory elements of a lodging house.18 See Packaging Indus. Group, Inc. v. Cheney, 380 Mass. 609, 615-616 (1980). His findings are supported by substantial evidence in the record, and his ultimate ruling determining the meaning of “lodging house” is not marred by legal error. See Jaffe, Judicial Enforcement of Administrative Orders, 76 Harv. L. Rev. 865, 866 (1963) *764(“The core of the judicial function where enforcement is in question is the determination of legality”).
b. Civil contempt. In each action here,19 the city filed a complaint requesting the judge to find the defendants in civil contempt, Mass.R.Civ.P. 65.3, for failing to comply with the preliminary injunction. The defendants answered and denied the allegations. Hearings ensued on April 14, 2010. The defendants argued they tried to comply but were stymied due to roadblocks attendant to the leases.20 The judge found them in contempt. “To constitute civil contempt there must be a clear and undoubted disobedience of a clear and unequivocal command.” United Factory Outlet, Inc. v. Jay’s Stores, Inc., 361 Mass. 35, 36 (1972). See Birchall, petitioner, 454 Mass. 837, 852 (2009). The city had the burden to prove the defendants’ undoubted disobedience of the injunction by clear and convincing evidence. It did so, and the judge correctly found as much. Nor was there any error in sanctioning them as the judge did here.
When announcing the fines during the April 14 proceedings, the judge made it known to the parties, in no uncertain terms, that he would hear them on vacating the fines if compliance was had by April 21, 2010. That did not occur, and the judge had no occasion to act on a request to erase the fines. On this record, there is no basis to do other than uphold the contempt orders.
The final judgments and orders of contempt are affirmed.
So ordered.
In pertinent part, G. L. c. 140, § 24, amended by St. 1982, c. 634, § 10, provides: “Upon the complaint of an aggrieved party, the licensing authority or an officer of a city or town wherein such unlicensed lodging house is conducted, a justice of the housing court division or the superior court division of the trial court, may enjoin the conducting of any unlicensed lodging house and may make such other orders as the court may deem equitable to enforce the provisions” of the Act.
There was a separate action for each of the five described properties.
The defendants did not pursue an interlocutory appeal under G. L. c. 231, § 118, second par. See Addison v. Belay, 440 Mass. 1010, 1011 (2003).
The judge imposed the following fines: $7,300 against College Hill Properties, LLC, and Paul F. Giorgio for 11 Boyden Street; $1,500 against Michele and Paul J. Meaney for 23 Caro Street; $1,500 against Michele and Paul J. Meaney for 21 Caro Street; $3,800 against Paul F. and Diana H. Giorgio for 13 Boyden Street; and $3,800 against Paul F. and Diana H. Giorgio for 7 Clay Street.
On September 25, 1990, the city adopted G. L. c. 148, § 26H, requiring lodging houses in Worcester to be equipped with sprinkler systems no later than the five-year grace period allowed by § 26H. See General Star Indem. Co. v. Duffy, 191 F.3d 55, 59 (1st Cir. 1999). Section 26H “is self-enforcing in the sense that it imposes directly on boarding and lodging houses the obligation to have automatic sprinkler systems, in contrast to authorizing the head of a fire department to issue orders requiring their installation.” Chief of the Fire Dept. of Lynn v. Allard, 30 Mass. App. Ct. 128, 129-130 (1991) (grace period had not expired). See Massachusetts Sober Hous. Corp. v. Automatic Sprinkler Appeals Bd., 66 Mass. App. Ct. 701, 704-705 (2006).
The regulatory method of licensure has a long history in the Commonwealth. See Liggett Drug Co. v. License Commrs. of N. Adams, 296 Mass. 41, 49 (1936) (“From the early days of the colony to the present, there have been statutory regulations concerning the licensing of common victuallers, innholders, and the sellers of intoxicating liquors”). See also Leduc v. Commonwealth, 421 Mass. 433, 435 (1995), cert. denied, 519 U.S. 827 (1996). Different subjects call for different licensing measures. See McMurdo v. Getter, 298 Mass. 363, 367-368 (1937) (licensing of business proprietors and “learned professions”).
The defendants would have us rely on definitions set forth in the State building code. We do not draw the meaning of a statute from words employed in a building code. See Enos v. Brockton, 354 Mass. 278, 281 (1968) (building code intended to be “more flexible” than zoning ordinance, which is authorized by zoning statute and “intended to have a certain degree of permanency”).
10“House" is defined as “a structure intended or used for human habitation: a building that serves as one’s residence or domicile.” Webster’s Third New Intl. Dictionary 1096 (2002). See Selvetti v. Building Inspector of Revere, 353 Mass. 645, 646 (1968) (“judge was right that the building is adapted for use as a lodging house”).
11 “A dictionary definition of ‘lodging’ is ‘accommodation in a house, esp. in rooms for rent’ and of ‘lodging house,’ ‘a house in which lodgings are let, esp. a house other than an inn or hotel.’ ” Selvetti, supra at 646.
12“Let” is defined as “an act of leasing or renting.” Webster’s Third New Intl. Dictionary 1297 (2002).
Included within the meaning of “lodging house” are “fraternity houses and dormitories of educational institutions.” G. L. c. 140, § 22. Exempt from the Act are dormitories of charitable and philanthropic institutions; convalescent and nursing homes; and group residences licensed or regulated by State agencies. Ibid.
In support, the defendants rely largely on an unpublished decision of the *762United States District Court for the District of Massachusetts: Vo vs. Boston, U.S. Dist. Ct., No. Civ. A. 00-11733-RWZ (D. Mass. Sept. 22, 2003). It suffices to say that, on the facts, Vo is distinguishable from the present controversy; to the extent (if any) that Vo suggests a different conclusion from the one reached by us, we decline to follow it.
An issue that has cropped up in zoning disputes is whether a group of unrelated individuals, living together in a single-family home or apartment, qualify as a family or single housekeeping unit. See Commonwealth v. Jaffe, 398 Mass. 50 (1986); Hall v. Zoning Bd. of Appeals of Edgartown, 28 Mass. App. Ct. 249 (1990). For example, in White Plains v. Ferraioli, 34 N.Y.2d 300 (1974), the question was whether a group home for ten foster children qualified as a single-family unit under a local zoning by-law. The New York Court of Appeals ruled it did, concluding the home met this standard: “The minimal arrangement to meet the test of a zoning provision, as this one, is a group headed by a householder caring for a reasonable number of children as one would be likely to find in a biologically unitary family.” Id. at 306.
Here, there was no evidence to suggest the students in any of these cases were functionally a single housekeeping unit. It need not be emphasized that “[t]he general aim both of the zoning by-law and of the licensing statute is the promotion of the public welfare, but each is independent of the other and seeks to accomplish its purpose by different means.” Marchesi v. Selectmen of Winchester, 312 Mass. 28, 31 (1942). Satisfying one does not necessarily entail legal compliance with the other.
The local zoning ordinance in Bonaventura, 56 Mass. App. Ct. at 168, defined lodging house as follows: “A dwelling or that part of a dwelling *763where sleeping accommodations are let, with or without kitchen facilities, to four (4) or more persons not within the second degree of kindred to the person conducting it. . . .”
At oral argument, counsel for the defendants made some suggestion, without a credible basis in the record, that the city’s license enforcement actions were selective and arbitrary. Counsel cautioned that, should the judgments be affirmed, the city might well take license enforcement actions against lawful two- or three-family apartment buildings, a claim we believe to be extravagant. We need not address an unfounded, hypothetical contention.
If issued to aid in the enforcement of a judgment, an injunction is subject to a traditional principle of judicial restraint that “injunctive relief should be no more burdensome to the defendant [enjoined party] than necessary to provide complete relief” to the plaintiff. Califano v. Yamasaki, 442 U.S. 682, 702 (1979).
See Leman v. Krentler-Arnold Hinge Last Co., 284 U.S. 448, 452-453 (1932) (civil contempt proceeding properly part of original cause of action).
The absence of wilful disobedience does not relieve a party from being adjudged in civil contempt, though it may be a mitigating factor in the assessment of an appropriate sanction. See National Labor Relations Bd. v. J.P. Stevens & Co., 563 F.2d 8, 16 (2d Cir. 1977).