moved a couple of local functions to the global repo