Move global functions to global