refactor simplify global declarations