fixup variable.cpp refactor