remove global state from main package