Move some global functions into autoload