wip: reset global state as needed