renaming global vars, cleanup
continuing renaming global vars, cleanup