some more global state rearranging for debugging purposes