A little over a week ago I was lying in bed when I heard a chattering and yowling and scratching at my front door. My dogs were losing their minds.

I ran downstairs and opened the door and nearly stepped on a tiny little critter, a baby raccoon about the size of the softball that could barely walk but somehow had toddled its way to my porch.

I’ve had plenty of pets in my day, but had zero experience with what to do with a baby raccoon. The kids and I coaxed him into a cat carrier and tried to take him down by the nearby creek, hoping he could find his way home.

I checked with an after-hours vet and was told they would have to destroy the little masked varmint. The next morning I called a wildlife rescue and was told the same thing — if they took in a raccoon and didn’t destroy it, the state could shut them down.

But 18 hours later, he was still hunkered under the bush where we’d left him. So we took him in.

The kids named him Wilson and we did our best to feed him kitten formula and water while we came up with a solution. To my surprise, I was able to find what is essentially an underground raccoon rescue — very cloak-and-dagger stuff — and the next day we sent Wilson off to a new life.

Maybe someday he’ll be dining on the garbage of some rich person who lives in the foothills or maybe he’ll become an internet sensation by climbing up the side of a building like that raccoon in Minnesota.

About three short months ago, saving Wilson would have been a Class B misdemeanor that could have landed me in jail for up to six months and a $1,000 fine. But during the last legislative session, Sen. Daniel Thatcher, R-West Valley City, championed SB180.

“Let me be clear. [What you did] is not legal,” he told me last week. “It has just gone from a Class B where you could do six months to an infraction, where you could be fined.”

The raccoon bill is just one fairly innocuous example of a multi-year effort Thatcher has spearheaded of “de-escalating” the state’s criminal code.

The problem has grown over time, as “tough on crime” politicians bump up penalties for minor offenses higher and higher.

A few years ago, for example, someone could have spent 90 days in jail for not burying a dead animal within a reasonable period of time, or an owner of a tanning salon could do the same time behind bars for letting minors into their tanning beds. But those and scores of other crimes were knocked down from Class C misdemeanors to infractions in a package of bills in 2015. And it’s a process that is continuing.

(Robert Gehrke | The Salt Lake Tribune) A baby raccoon showed up on Robert Gehrke's porch recently and, after trying to return the critter, he took him in. Until March, that would have been a Class B misdemeanor punishable by up to six months in jail.

A bill Thatcher sponsored directed the Utah Sentencing Commission to prepare a report on all of the offenses for which a violator can be arrested. That’s where the raccoon law showed up.

“I said, ‘Shouldn’t the consequences for holding a raccoon be that you’re holding a raccoon with the possible sentence of rabies?’” Thatcher said. “Why would six months in prison be appropriate punishment?”

And it’s not just silly things — like racoons — where the lock-’em-up mentality is being reassessed.

(Robert Gehrke | The Salt Lake Tribune) A baby raccoon showed up on Robert Gehrke's porch recently and, after trying to return the critter, he took him in. Until March, that would have been a Class B misdemeanor punishable by up to six months in jail.

Last session, Thatcher also knocked down the penalties for shoplifting after he was told that 53 people are serving up to five years in prison for committing three retail thefts within 10 years. And in 2015, the state reduced the penalties for several dozen drug crimes as part of an effort to transition from locking people up to rehabilitation.

The Justice Reinvestment Initiative, as it is called, has shown some positive results, despite being hamstrung by a lack of funding, particularly for drug treatment programs. The number of people behind bars has been decreasing and, so far this year, the percentage of crimes being charged as felonies is at its lowest rate since 2013.

Thatcher said the constant reassessment is something he’s committed to continuing.

“It’s something we’re going to do every single year and find things where we say, ‘Really? A year in jail for this? Is that appropriate?’ ” he said. “And if it’s appropriate, we’ll leave it. And if it’s not, we’ll get rid of it.”

It’s a smart approach to public safety, and one that could pay dividends in lower costs for taxpayers, a better shot for convicts to put their lives back together, and maybe even a new lease on life for baby raccoons.