removed some global vars which should be static instead