On TV he played a ruthless mobster pursued by the Feds. But in real life actor James Gandolfini was a generous soul. Indeed he may even have endeared himself to the IRS as his will is revealed as an example of how not to settle your affairs, according to the experts.
Gandolfini's will was written in a way that astute estate planners say skipped many options for minimizing his tax bill.
(Read more: Actor James Gandolfini, star of 'The Sopranos,' dies in Italy)
One example: Gandolfini left just under 20 percent of his assets to his wife, with the rest going to his sisters and infant daughter. (He made "other provisions" for his son Michael from a previous marriage, the will says.)
Federal tax laws allow for unlimited tax free transfers to spouses, but taxes are applied to most other bequests in estates over $5.25 million. Gandolfini only took limited advantage of that provision, so close to 80 percent of the assets covered by the will could now be subject to state and federal taxes that together can reach a rate of 55 percent.
Certainly, Gandolfini may have had priorities other than taxes. He may, for example, have wanted to make sure Michael had his own inheritance so he would not be dependent on his stepmother.
"I very often have clients that make very well informed decisions that might not be the most tax efficient," said Mickey Davis, a partner at Davis Willms.
Also, while the size of Gandolfini's estate is unknown – published reports estimate $70 million, but Gandolfini's estate attorney told The New York Times that figure is not accurate - the estate was almost certainly substantial, and Gandolfini may well have had assets like retirement accounts and life insurance policies that are not covered by the will and its tax rules.
(Read more: Retirement planning can help high earners avoid big tax hit)
But legal and tax experts say that if minimizing taxes was a priority, Gandolfini's will could have been better written.
"You don't know what was explained to him and you don't know what his choices were," said Christina Mason, a partner at Kelley Drye & Warren. "Probably three-quarters of people approach it in the most tax efficient way, but the others don't." From what's been revealed about his estate, Gandolfini seems to have been in the latter camp, she added. "On the face of it, it looks as though it's very tax inefficient."
So how can you be smarter than James Gandolfini when it comes to estate planning?
For starters, consider taking greater advantage of the marital deduction. If you leave all your assets to your spouse, you don't owe estate taxes. (Your spouse's estate will, though, if it is large enough.)
Trusts are another tool for managing large estates. Gandolfini "could have made some significant gifts to his siblings and to his daughter and put them in trust and told the trustee 'don't distribute these until I'm gone, but grow these during my lifetime,'" Davis said. "Once he's put them in trust, the assets would avoid the estate taxes."
(Read more: Yours, hers, and the kids': estate planning after remarrying)