refactor global variable
refactor console