do away with all those naughty global variables