Getting rid of all global variables