we have this code duplicated in many places. Can we add a convenient function someplace, for instance, fb_contact_utils.js that centralizes these calculations in only one place?