Shared utility code used @ Dimagi