Getting rid of unneeded globals