In his petition for a writ of habeas corpus, Michael Kevin DuPont, a prisoner, focuses particularly on good time credits of which he claims to have been wrongly deprived. A judge of the Superior Court denied his petition. We affirm.
1. Background. In order to come to grips with the issues presented, it is necessary to set out DuPont’s convictions and sentencing history. So far as material to this appeal, the first batch of convictions and sentences imposed on DuPont occurred in 1971 and 1972. For armed robbery, DuPont received a sentence on October 27, 1971, of fifteen to thirty years. On March 13, 1972, DuPont was convicted of breaking and entering and larceny. There were further armed robbery convictions on June 29, 1972, and September 21, 1972. The sentences for these crimes — they involved separate criminal episodes in different places — ran concurrently with the 1971 sentence. For convenience of reference, we shall refer to these convictions collectively as the 1971 sentences.
On November 7, 1980, DuPont was paroled. In short order he was under arrest for breaking and entering and several other crimes, resulting in revocation of his parole on December 10, 1980. As to these charges he was convicted and on March 12, 1981, received a second set of sentences (the 1981 sentences) to run “from and after sentence now serving.”
About nine months later, on December 23, 1981, DuPont was paroled from the 1971 sentences to the consecutive 1981 sentences; i.e., he began serving the 1981 sentences before the expiration of the 1971 sentences. On May 21, 1984, he was placed on parole, and on the street, from the 1981 sentences. Within a month, specifically on June 23, 1984, DuPont was arrested on charges of receiving stolen property, possession of unlawful drugs, and unlawfill possession of a firearm. This resulted in DuPont’s return to custody on the 1971 sentences and the violation of the parole from the 1981 sentences served as a detainer. The parole revocation warrant on the 1981 sentences was withdrawn on January 22, 1985, and on February 12, 1985, DuPont was assigned to a prerelease halfway house called the 577 House. He had not been there a month when he was involved on March 7, 1985, in a criminal episode that led to his conviction of armed robbery, assault and battery by means of a dangerous weapon, armed assault with intent to kill, and lesser offenses. For the armed robbery, DuPont drew a sentence of thirty to forty year's (the 1986 sentences), to run from and after sentences then being served.
DuPont’s sentencing picture, already complicated, became more so on December 4, 1987, when a motion for a new trial on the 1971 armed robbery *909charge (fifteen to thirty years) was allowed. Thereupon DuPont entered a plea of guilty and received a revised sentence of ten to eighteen years. He was now entitled to be discharged from custody under the 1971 sentences and that occurred on February 4, 1988, to be effective as of January 26, 1985. There was also a revision of the 1986 sentences (for the 1985 crimes committed while he was in the prerelease halfway house) following another successful motion for a new trial by DuPont. On December 13, 1999, DuPont entered a plea of guilty as to the March 7, 1985, crimes. Sentencing on that plea did not occur until November 10, 2000, on which date a Superior Court judge imposed a new sentence on the 1985 armed robbery of twenty years to twenty years and one day and lesser concurrent sentences on the other crimes committed in 1985.
2. The good time credits. By the calculations of the Department of Correction (department), the discharge date for the 1985 armed robbery (service of the sentences on the lesser crimes has been completed) is January 21, 2005. He must then serve the balance of the 1981 sentences, three years and four months, so that his wind-up date from all sentences is May 24, 2008. If DuPont is entitled to statutory good time credits against the sentence for the 1985 armed robbery, his discharge date would have been February 2, 2000.
Under G. L. c. 127, § 129, “If, during the term of imprisonment of a prisoner confined in a correctional institution of the commonwealth, such prisoner shall commit any offense of which he shall be convicted and sentenced, he shall not be entitled to any [statutory good time] deductions hereunder from the new sentence or sentences of imprisonment.”2 DuPont makes two arguments in support of the proposition that he was not confined in a correctional institution at the time of the March 7, 1985, armed robbery, and that, therefore, he was entitled to accumulated good time deduction from his sentence for that crime.
a. Status of halfway house. At the time of the 1985 offenses, DuPont, it will be recalled, was assigned to a prerelease program in a halfway house. DuPont urges that such a facility, outside prison walls or prison grounds, is not a correctional institution of the Commonwealth. He goes on to reason that as he was not confined in a correctional institution, any crimes he committed, and of which he was convicted, while at the halfway house should not cost him good time credits. The argument is defeated by our decision in Nimblett v. Commissioner of Correction, 20 Mass. App. Ct. 988, 989 (1985). There, a person serving a sentence while engaged in a work-release program outside the physical confines of M.C.I., Monroe, committed manslaughter. We concluded that someone “permitted to be outside the physical confines of a State correctional institution on a work-release program. . . must be taken to be ‘confined in a correctional institution of the commonwealth.’ ” Ibid. DuPont was assigned to a specific physical facility. He was not free to come and go from it as he pleased nor could he choose to live elsewhere. The halfway house was a confining place of rehabilitation and comfortably fits the defini*910tian of “correctional facility” and “correctional institution” that appears in G. L. c. 125, § 1: “any building, enclosure, space or structure used for the custody, control and rehabilitation of committed offenders . . . .” See Commonwealth v. Hughes, 364 Mass. 426, 428-429 (1973), interpreting G. L. c. 127, § 90A, and defining the status of a prisoner on furlough as in the custody of a correctional facility. Contrast Commonwealth v. Speight, ante 28, 32 (2003), in which we decided that attendance at an inpatient drug facility as a condition of probation was not to be counted as a period of service of a committed sentence. Also contrast Commonwealth v. Beauchemin, 410 Mass. 181, 186-187 (1991), in which confinement as a condition of stay of execution of a sentence pending appeal was held not to produce a credit for time served. DuPont makes an additional argument that is charming for its gall but entirely unpersuasive. He suggests that as he committed his 1985 crimes approximately six months before publication of the Nimblett opinion, he did not have notice that commission of crimes while he was at the halfway house would cost him his good time credits so far as the 1985 crimes were concerned. If DuPont, indeed, consulted the Massachusetts Reports and Massachusetts Appeals Court Reports before deciding to commit a crime, he would have found guidance that a halfway house would qualify as a place of confinement from Commonwealth v. Hughes, 364 Mass. at 428-429. He did not need to wait for the Nimblett opinion to understand that good time credits could be lost while outside prison walls. For a case to the same effect as Hughes, but after Nimblett, see Rachal, petitioner, 25 Mass. App. Ct. 126, 129-130 (1987).
b. Gap between sentences served. The next argument that DuPont presents for the proposition that he was not confined in a correctional institution on the day he committed the 1985 offenses, March 7, is clever, highly technical, but in the end unsound.
When in December, 1987, DuPont was resentenced on the 1971 crimes, he was declared as having served his sentences for the 1971 crimes as of January 26, 1985. As to the 1981 sentences, he had been returned to parole on January 22, 1985. Hence, DuPont argues insouciantly, he was not confined for anything on March 7, 1985, when he committed the various crimes, notably armed robbery, that earned him the sentence against which he claims good time credits. The fact is, however, that DuPont was confined on March 7, 1985; he was confined to the 577 House, the halfway house, on the 1971 sentences. Those sentences at the time had a wind-up date well past March 7, 1985. The January 26,1985, wind-up date was the product of a later — 1987 — resentencing. That resentencing, the reader may recall, occurred in the wake of an allowanee in 1987 of a new trial motion on the 1971 offenses and DuPont’s guilty plea. DuPont argues that as the original 1971 sentences were the result of a flawed trial, his confinement in the halfway house was unlawful, he was not properly in confinement on March 7, 1985, and, therefore, he is entitled to good time credits against the sentence for the 1985 offenses. In so contending, DuPont relies substantially on Lynch, petitioner, 379 Mass. 757 (1980). The Lynch case concerned a prisoner whose parole had been unconstitutionally revoked by the Parole Board. Id. at 758. The Department of Correction could not, as it sought to do, deprive the defendant in that case of good time credits because he should not have been confined in the first place. DuPont, however, reads only a part of the Lynch opinion. It goes on to state that when a person *911is confined in accordance with a duly imposed sentence, that confinement is lawful until the conviction or the sentencing process that led to it is reversed through the legal process. Id. at 760. The department had properly denied DuPont good time credits he accumulated against the sentence imposed for the 1985 armed robbery. See Rachal, petitioner, 25 Mass. App. Ct. at 130-131.
Michael Kevin DuPont, pro se. David Slade for Commissioner of Correction.3. The Apprendi argument. As further ground that he is now improperly detained, DuPont suggests that the statute which causes a forfeiture of good time credits, G. L. c. 127, § 129, unconstitutionally enhances the penalty for the crime that causes the forfeiture. For this he points to Apprendi v. New Jersey, 530 U.S. 466 (2000). Apprendi fired several shots into the home of an African-American family. He entered a plea of guilty to possession of a firearm for an unlawful purpose and unlawful possession of an antipersonnel bomb. The prosecutor then moved for an enhanced sentence under NJ. Stat. Ann. § 2C:44-3(e) (West 1995), which pertained to a crime committed to intimidate an individual or group because of race, color, gender, handicap, religion, sexual orientation, or ethnicity, i.e., a hate crime. The judge who had taken the pleas found as fact that Apprendi had acted to intimidate because of race, and imposed greater sentences for the underlying offenses. The Court held that Apprendi was entitled to a jury to determine whether the underlying crimes had been motivated by a desire to intimidate because of race. Id. at 490.
In DuPont’s case there is no dispute of fact about the armed robbery of 1985 nor where DuPont then was; he was a resident of the halfway house. That this was a state of being confined in a State correctional institution was, as we have seen, a question of law. Nor is the loss of statutory good time credits an enhancement of the sentence being served. The Apprendi decision does not help DuPont.
4. Entitlement to a hearing. DuPont was not entitled to an evidentiary hearing, as he claims, concerning the forfeiture of his good time credits. A hearing is required when there are contested issues of fact, e.g., whether the prisoner committed an offense that cost a loss of good time; a hearing is not required for the application of a statute to uncontested facts. Rachal, petitioner, 25 Mass. App. Ct. at 131-132.
5. Jurisdiction of Parole Board. DuPont waived a point concerning jurisdiction of the Parole Board at oral argument. In any event, a petition for habeas corpus would not concern the Parole Board because DuPont was not in the custody of the Parole Board.
Order denying petition for writ of habeas corpus affirmed.
Section 129 of G. L. c. 127 was repealed by St. 1993, c. 432, § 10, the repealer made effective July 1, 1994, by St. 1993, c. 432, § 21. Although repealed, the statute remains in effect as to sentences imposed while § 129 was in force. G. L. c. 4, § 6, Second, which provides that “[t]he repeal of a statute shall not affect any punishment, penalty or forfeiture incurred before the repeal takes effect.” See Patrick v. Commissioner of Correction, 352 Mass. 666, 669 (1967).