de-globalize variables