By Matthew Geagan, CBS Boston

BOSTON (CBS) — It was sloppy, frustrating and, at times, a little too close for anyone’s comfort. But in the end the Patriots leave the Golden State with a 30-17 win over the San Francisco 49ers.

READ MORE: Nearly Half A Million Lose Power As Nor'easter Hits Massachusetts

It was a wet one at Levi’s Stadium for most of the afternoon, but Tom Brady wasn’t about to let Mother Nature rain on his California homecoming. Brady threw four touchdowns en route to career win No. 199, and put on a show for his hometown fans who were more than happy to serenade him with numerous “Brady!” chants.

The Pats went nearly two full quarters without scoring, making the game much closer than it ever had to be against a bad 49ers team. But the Patriots improved to 8-2 with the win, and they hold on to their two-game lead over the Miami Dolphins in the AFC East.

Here are all the Ups and Downs from Sunday’s win in Santa Clara:

Ups

Brady Works His Magic

Brady slid up in the pocket to buy his receivers some extra time on numerous occasions, and it made a big difference on a pair of key plays.

First, early in the fourth quarter and with the Pats in need of a touchdown, Brady pulled a nice spin move to escape the San Francisco rush. To complete the impressive play, he threw from his back foot and found Danny Amendola open in the middle of the end zone for his third touchdown pass of the day. It put the Patriots up 20-10, and essentially broke the 49ers’ back.

Brady bought a few more seconds on his fourth and final scoring pass of the afternoon as well, moving up in the pocket before threading the needle to Malcolm Mitchell. The rookie took the 24-yard strike from Brady and turned it into a 56-yard touchdown, putting the final nail in the coffin.

Brady and the offense had their struggles in the middle of the game, but Brady stepped up (in more ways than one) without the services of Rob Gronkowski and Chris Hogan.

Malcolm Mitchell

The rookie receiver had that beautiful touchdown, the first score of his career, but he also got the offense going with a key third down conversion in the third quarter. With the Pats facing a 3rd-and-9 at their own 21, Mitchell had a huge 21-yard catch to keep the drive alive. That drive ended with Brady’s five-yard score to Amendola at the start of the fourth quarter.

He entered Sunday’s game with just seven catches for 95 yards on the season, but Mitchell finished Sunday with four catches for 98 yards to lead all New England receivers.

Big Day For New England Running Backs

LeGarrette Blount was a beast, rushing for 129 yards on 19 carries. James White was a big factor in the passing game, catching all six of his targets for 63 yards and a touchdown.

Dion Lewis also made his long awaited return, taking the field for the first time in over a year. He picked up a first down on his first catch, finishing with three receptions on five targets for 26 yards while adding 23 yards on five carries.

Third Down Defense

The defense remains a work in progress, to put it lightly, but there was some improvement on Sunday.

Allowing third down conversions was a big issue for the Patriots last week against Seattle, who converted on six of their 12 third downs. The Pats’ D was much better today, as the 49ers finished the afternoon converting on five of their 14 third down tries. Those numbers were inflated a bit with three conversions on San Francisco’s final drive with the game out of reach.

READ MORE: Dr. Mallika Marshall's Answer To Viewer's Question Leads To Breast Cancer Diagnosis

Bonus: A Little Bit Of Pressure

Even without Jabaal Sheard (who was left at home), the Patriots defense got some pressure on Colin Kaepernick, sacking the 49ers quarterback five times. Four of those came in the first half.

It was far from perfect, but there were a few areas of improvement for the New England defense. They’ll have to improve a lot more though if they want to win back any confidence.

Downs

Solder’s Costly Penalty

Left tackle Nate Solder struggled all day, but his biggest mistake was a holding penalty on what would have been a 35-yard touchdown run by Blount. Granted, there likely wouldn’t have been a score without the hold, but that could have turned this one into a blowout with the Patriots taking a 20-3 lead.

Instead, a 2nd-and-1 turned into a 2nd-and-11 and the Pats were forced to punt a few plays later. The 49ers scored on their next drive, making it a 13-10 game and much closer than it ever needed to be.

Forcing It To Edelman

It was also a homecoming for Julian Edelman, a Redwood City native, and it seemed like Brady was forcing it to his California counterpart for much of the afternoon.

The duo did have it going early, with Edelman hauling in Brady’s first touchdown pass of the day, and he finished with eight receptions for 77 yards. But those eight catches came on 17 targets, and many of the attempts had little shot of being completed.

There was no Gronk in this one, so it’s easy to see why Brady would go to his security blanket over and over again. But when it was clear that the 49ers had Edelman covered, Brady should have attempted to go elsewhere.

No Turnovers

The defense remains the biggest area of concern for the Patriots. They are back to their “bend, don’t break” ways, which works against teams like the 49ers.

But it doesn’t help that the D can’t seem to force a turnover. For the second straight week they didn’t come up with a takeaway, despite five 49ers fumbles on the afternoon. The Patriots defense has nine takeaways on the season, with just one in the last four games.

It’s getting late in the year, and it still doesn’t look like the Patriots defense can win this team a game if they need to.

Another Gostkowski Miss

Gostkowski missed his third extra point of the season after the Patriots’ first touchdown of the day. The rain could have played a factor, but it appears Gostkowski’s struggles continue.

But don’t feel too bad, because Gostkowski was far from alone this week. In total, there were 11 extra points missed in the NFL on Sunday.

Matthew Slater Hurt

MORE NEWS: Despite Nor'Easter, Tourists Flock To Salem To Celebrate Halloween

The special teams captain left in the third quarter with a foot injury and did not return. He was seen in a walking boot and on crutches in the Patriots locker room after the game.