move miscfuncs to more sensibly named util