Should we move this to a utility library? I know it's used in `contacts.js`, but don't know if makes a lot of sense to have it here. wdyt?