move global funcs to each env