Revert "rm unused UniqueRefDefs func"

This reverts commit d95bdd0c0a1b21844f02b2d2ab4a1d9d9776e46a.