getvar should be semipure
More cleaning up and redefinition.