Scoped variables

cc @d4tocchini