move these into mop::internals::util