Consolidated VariableCache code