moved some fns to utils