Of note, the average annual salary can drop a hair, and still be better for the player, depending on how you spread it out.
If the Sens proposed it as a 5 year deal of 8 / 4 / 4 / 4 / 3, this would actually be preferred by the agent and player versus a 5 year deal that was 3 / 4 / 4 / 5 / 8, even though the second offer is slightly more money.
Term and average is not the only factor. Alfie's last contract with the team was heavily front loaded, with the last year at $1M, which made deal much better than the average annual salary, because Alfie could have retired on the last year, and seen his average annual salary jump substantially. And even if he didn't, he got most of the money right away, which with interest accrued over the term of the deal, will mean he has a lot more in his pocket 5 years later than the same money back-ended.