Better scoping for function calls