Moved and refactor loadVar function
Moved readVarInfo function
Extracted part of storeVar function