Moved some functions from g_local.h into new headers