major refactoring, removing more statics