preparations for apply/apply_n and local variable declarations