remove global.h
remove cid, imporve performance