Reorganizing some common functions to from mups and Emeshe