mixed case variables and remove some global variables