Thats called an upvalue. If a local variable is referenced in a new closure, it will live as long as the closure exists. Its the concept of lexical scoping, which in conjunction with first-class functions, makes Lua so powerful. Details at 
When you have 5 bars that need exactly the same config, you can shrink that down to nearly 1/5th of the code. You can write generic options tables that act on some metadata in the tables, that way you don't have to repeat them for every bar you add.