To answer your question if this is the most right solution: no it isn't. The use of uplevel/upvar is very application specific, and your example is about as far away from needing either of these features (and you use both), that you can get. If you have the actual code you want to run, then show us that so we can offer more a realistic assessment. Maybe start by reading the manual entry for uplevel/upvar.