refactor variable_info.cpp

this is a strict refactor which shouldn't change the compiled code.