Code cleanup
Use g_... for global variables and E_... for enums