A recent Recorder story reported that there’s just one homeless family now housed in one of Greenfield’s motels.

That is good news in many ways for the parties involved: the men, women and children who were brought here, the town, schools and other organizations that were providing these families with social services and the state agencies that brought the homeless here as an answer to an emergency need.

Back when Greenfield unexpectedly became the state’s choice landing spot for emergency shelter three years ago, turning two motels in town into de facto homeless shelters for people from urban areas east and south of Franklin County, state Sen. Stanley Rosenberg, now the Senate president, said finding answers to the problem would be neither easy nor fast.

That it has taken more than three years to see the number of homeless families housed in Greenfield motels drop from around 100 to just one is a measurement of that difficulty. As Rosenberg said in 2013, there are several factors that leave people without a home.

But it’s also a testament to the continuing work by the state to help these families find more permanent and better housing options — and in many cases getting them back to their own communities.

Credit has to go to state’s HomeBASE program, created under the administration of former Gov. Deval Patrick with the goal of providing short-term housing help.

And credit should also go to Patrick’s successor as governor, Charlie Baker, in seeing the value in HomeBASE in helping reduce the number of families living in emergency shelters.

As of the middle of May this year, there were 538 homeless families staying in state-funded hotels and motels That number is down from the 1,500 families living in emergency housing when Baker took office in January 2015 and from even higher levels back in 2013.

“When families come to the Department of Transitional Assistance, we ask, ‘What are the barriers that have made it so you’ve ended up homeless?’”a state Executive Office of Housing and Economic Development spokeswoman said. “A small thing suddenly becomes some large expense, and HomeBASE is one thing we can offer them to stabilize in place, to keep from becoming homeless or if they need an extra boost to get them over the hump, like a security deposit.”

As successful as this program may be, however, there’s always the possibility of another surge in homelessness and the need to use motels like the ones in Greenfield. As Rosenberg pointed out three years ago, “permanent, affordable housing is extremely difficult to come by in Massachusetts, and that’s one of the biggest problems we’re facing.” That continues to be an issue today.

And until the state can tamp down homelessness itself, it should have in place a better way of helping communities like Greenfield that may once again host the homeless. A report from state Auditor Suzanne Bump’s office found that putting up homeless families in Greenfield motels was costing the town more than $300,000 a year, mostly in education costs. One of Bump’s suggestions was for the state to provide reimbursement, though no specific amount was offered.

At the very least, the state must do a better job of communicating with communities should the need arise to house homeless families, so local agencies and schools aren’t caught off guard and flat footed.

Again, the reduction of homeless families in Greenfield motels is to be noted. But the work to ensure that this type of situation doesn’t recur is ongoing.