Move misc funcs to misc module