Moved in idtype and other utils functions from CellMix