At many points in the past year, it was a foregone conclusion Colin Kaepernick would never play for the 49ers again. Then, it was clear that he was done in the Bay Area after 2016.

Now?

It would not be a surprise if Kaepernick was the team's starting quarterback in 2017, sources said. There is still a chance he re-signs with San Francisco this offseason, and it's certainly not something to rule out like it once was.

But, as several sources explain, a few things will happen first.

When Kaepernick signed a revised contract that wiped away the final four years of his extension and limited his guaranteed money, it gave him the chance to opt-out after the season.

Kaepernick will, in fact, void his contract before the league year and become a free agent, sources said. This creates a scenario where Kaepernick can test the market, sign a contract that gives him much greater peace of mind, and still end up back with the Niners.

Some factors are at play. First, he's playing great, becoming the quarterback coach Chip Kelly always imagined in his system (even during his time in Philadelphia). Second, the once-strained relationship between the franchise and the quarterback is in a very good place.

The 49ers stood by him while he took a hard social stance -- he appreciated that, and most of the issues that lingered when he nearly was traded to the Broncos have dissipated. Things are good between Kaepernick and the team, and his decision to put his San Jose house on the market this week had nothing to do with football.

The 49ers are trying to find the best quarterback (or two) for their franchise, and it's hard to argue Kaepernick hasn't stated his case.

The losses have piled up for the 49ers, though opposing coaches have privately noted after each game that they look like a team that is playing well ... just without a lot of ready talent. Over the last four games, Kaepernick has played as well as anyone.

Finally back at full strength and weight, Kaepernick threw for 296 yards last week in a close loss to the Dolphins, going 29 of 46 (63%) with three touchdowns and one pick. He also rushed for a whopping 113 yards -- reminding observers of old times.

Over the last four games, he's 86 of 145 for 1,110 yards with eight TDs and two interceptions. Stellar. He's also rushed for 223 yards over that span.

It sets up a scenario where he's back in the Bay for 2017, but with a contract he can feel happier about. When he inked his six-year, $126-million extension, it was widely debated. He received far less fully guaranteed money compared to most quarterbacks, and the pay-as-you-go model was one no quarterback wanted to imitate. Perhaps when he tests the market -- and there will be suitors -- he'll find a value he can be happier with.

And the Niners can have a quarterback they'll be happy with for years to come.