I've moved all_vars and loop_vars, but the code init'ing also produces vars_code, so moving it into a helper would be a bit awkward.