get rid of some global refs