Cleaning up global variables