Narrow down a variable's scope