Manually Recalc Memberships

Former Member
Former Member $organization

We have a utility that lets us link/unlink contributions to/from a membership.  The "problem" is recalculating the membship amount and avc amount. Is there a utility or procedure somewhere that will let me automatically re-calculate the membership contribution amounts?  I basically want to replicate the functionality under the Recalc button on the Membership Contributions dialog. Right now, someone has to remember to open the membership and manually hit the Recalc.