de-globalized several more variables