move those funcs to top level