Improving the code of global and local assignments