The sequence of events that ended in the Nov. 15 escape of four inmates from the Harborfields juvenile detention center in Egg Harbor City began in 2004.

Until then, Harborfields was Atlantic County’s all-purpose juvenile-justice facility, where kids were taken automatically when they did something wrong. Most of those filling its 27 beds were in for minor offenses and not dangerous.

But in 2004, the county reformed its juvenile-detention practices, moving most offenders to homes or youth shelters and monitoring them with electronic bracelets. That is more appropriate and makes it less likely kids will become repeat offenders and serious criminals.

Harborfields changed to a detention center for the few juvenile offenders deemed dangerous. Even though it started taking them also from Cape, Cumberland and Salem counties, the average number at the facility fell to about seven.

There were eight there on Nov. 15, when one asked in the early morning for a glass of water, overpowered the guard delivering it and led an escape of half the inmates. All were recaptured within two days, including a suspected murderer who allegedly had a gun when caught.

Atlantic County Executive Dennis Levinson has expressed outrage, shared by much of the public, that the escape was made possible by a guard not following the rules — apparently including entering a cell without backup and opening a cell door during lockdown time for a nonemergency.

Failure to follow detention center rules is a serious mistake and mustn’t happen again. Levinson was also rightly appalled that Harborfields guards don’t get the same training as corrections officers, and that should happen now.

But the fact that Harborfields and its dangerous inmates still have counselors instead of corrections officers suggests the basic problem may be that it hasn’t completely changed in line with its more serious purpose since 2004.

For example, shouldn’t a cell for a dangerous inmate have a built-in means to give the inmate a drink without opening the cell?

Maybe the Harborfields physical plant has features and conditions designed for detaining a lot of kids in trouble that aren’t fully appropriate for dangerous inmates, who now might remain there into adulthood.

The procedures at Harborfields should be reviewed as well. Maybe opening a cell in a nonemergency shouldn’t be a decision left to a single guard.

This isn’t the first time the facility and procedures have been found wanting. In 2012, five inmates escaped and, fortunately, also were quickly recaptured without harm to the public. In hindsight, that looks like a missed opportunity to fix things at the center.

The county Prosecutor’s Office is investigating, and the state Juvenile Justice Commission that operates Harborfields is surely analyzing matters.

We hope their actions focus not on the punishment of Harborfields workers, but on the improvements that have been needed for years — probably since the beneficial reform of juvenile justice.