Abandon the institution of marriage entirely. Nuke it from orbit, as it were. It's the only way to be sure.
The legal end of it is a mere wealth-redistribution mechanism. The social end of it is made of community who loves to witness people getting into marriages, but they scatter during the demise. So what function does it perform? From my perspective, it only serves to weaken commitment by trying to offload the responsibility of staying together to a legal framework.
Can anybody make a good case for continuing the charade?