replaced g_malloc/g_free with original + enum const