To fix traffic problems, you have to create new ones. At least temporarily. Travelers on two busy state routes through Northampton and Hadley face  months of road work that, in time, should improve the flow of traffic and increase safety.

In Hadley, the long struggle to keep traffic moving on Route 9 will take up a project to widen the road from Whalley to Middle streets.

That’s not a big stretch of road, but a congested one, running from the location of the Juvenile Court and the Most Holy Redeemer Church to the intersection with Route 47 at the foot of Town Hall. The finish date is a year from this coming September; the road will remain open, with lane restrictions.

The state is covering  the bulk of the Hadley job’s $3 million cost. This week, work begins to replace natural gas lines, with actual construction to start in June. Nonetheless, the timing of the work raised concerns at the Hadley Select Board last week, since it comes before Mother’s Day and Memorial Day.

Travelers will be wise to take the long view, especially while stopped in traffic. Past work to widen Route 9 closer to the Coolidge Bridge paid dividends. And more lies ahead.

The town will be working with the state Department of Transportation again and again in the decade ahead because this vital artery is used by more than 25,000 vehicles a day, according to a 2013 traffic count. The town, meantime, is getting state help with infrastructure problems, including replacement of water pipes that are, in some cases, 100 years old.

In Northampton, a new roundabout is around … well, not quite a corner, exactly.

Using about the same time frame as the Route 9 repairs, a state contractor will construct a roundabout at the junction of Pleasant and Conz streets on downtown’s southern gateway. As in Hadley, traffic will keep moving during the work, which will also repair gas and water lines and replace sidewalks. Prep work is planned this year, with new curbing to appear in 2017 as the traffic control system takes shape.

Anyone who drives this section of Pleasant Street knows it to be a hazard that needed fixing. But there will be a little pain before the gain.