cleaning up global state