refactor global variable struct global_context global