Get rid of statics and some global values