New Orleans Saints defensive coordinator Dennis Allen talks to players during the first day of training camp open to the public Saturday, July 29, 2017, at the Saints training facility in Metairie.

The New Orleans Saints' defense remains something of a mystery a quarter of the way into the season.

The Saints spent two weeks looking disorganized and overwhelmed defensively, then shifted gears in the span of seven days and played disciplined, opportunistic football against Carolina and Miami.

Dennis Allen's job is to make sure the New Orleans defense builds off of those two performances rather than reverting back to its struggles against Minnesota and New England.

"We have to ... continue to build off of two solid performances, because the NFL is about consistency," Allen said. "The NFL’s not about being the roller coaster team that’s up and down."

Allen, in his second full season as the coordinator charged with turning around the Saints defense, deserves a lot of credit for stopping the snowball effect of the first two weeks.

New Orleans gave up 1,025 yards to New England and Minnesota, including 777 through the air, hemorrhaging big plays while struggling with mental errors and missed assignments, particularly in the secondary.

"You can make mistakes up front; they don't get noticed near as much," Saints linebackers coach Mike Nolan said. "But when you make mistakes on the back end, it costs you points."

Allen knew he had a young defense this season.

But he admits the mistakes the Saints made in the opener against Minnesota came as a shock.

"Quite honestly, I was surprised at the way we played in the opening game," Allen said. "I know that we didn’t execute as well as we should have. I know that we didn’t do our job as well as we should have and what the reasons were for that, that’s what I can’t quite put my finger on."

Allen said he has not altered his scheme significantly, a claim backed up by linebacker A.J. Klein after the shutout win over the Dolphins.

But he has worked hard to tailor the game plan to the individual strengths of his players. For example, after safety Kenny Vaccaro struggled at times with assignments in deep coverage the first two weeks, he has 10 tackles, an interception, two tackles for loss and two passes defended in the past two games.

New Orleans has also played more three-safety sets the past two weeks, a decision made necessary by injuries at cornerback and the need to use better tacklers against Miami running back Jay Ajayi last Sunday. 

Whatever strings Allen has pulled have worked. After that awful start, the Saints have given up just 474 yards combined in the last two, including a paltry 284 passing yards, and produced eight sacks and four interceptions.

"I give a lot of credit to Dennis Allen," said Nolan, himself a revered former defensive coordinator. "He's done a real good job of game-planning the last couple of weeks; even before that, I thought we had good plans in those games."

New Orleans also played better situational football the past two weeks. After allowing opponents to convert 57.6 percent of third-down opportunities in the first two games, the Saints held Carolina and Miami to 36.4 percent.

"We've seen a couple of good rushing attacks, and we've been able to play well on early downs," Saints coach Sean Payton said. "In the last two games, we’ve played quite a bit of the game in the opponent’s end of the field, and I think that has helped with the field position, and I thought our third-down defense has been better and we’ve gotten off the field, where in the first two weeks we hadn’t."

Allen's job now is to keep those trends heading in the right direction, no easy task considering the quarterbacks looming on the Saints' schedule after the bye week.

Detroit's Matthew Stafford and Green Bay's Aaron Rodgers figure to present much tougher tests than Carolina's Cam Newton and Miami's Jay Cutler, and the Saints are going to have to find a way to make the NFC North pair work for their yards and points.

"There are no easy ones in this league," Allen said. "Hopefully, our guys understand that and realize that the margin for error in this league is very, very minimal, and you have to prepare extremely hard and get yourself physically, emotionally and mentally ready to play a game every week."

So Allen is cautiously optimistic about the way the Saints have played the past two weeks against Carolina and Miami. As good as the Saints have looked, Allen knows they have to keep putting these performances together if they're going to break the cycle of defensive disappointment that has plagued the Saints for three seasons.

"Rarely are things as bad as they seem, and rarely are they as good as they seem," Allen said. "I think the truth lies somewhere in between, but our deal is we are searching to find that consistency, because that what are the really good teams are. They are consistent, and you don’t have a lot of these peaks and valleys."

Follow Joel A. Erickson on Twitter, @JoelAErickson.