Move some duplicated fns into common ns.
wip
wip