Handle passing around variable scope