Perf improvement for getVars