move functions to top-level