Moving shared code to hri_common