organize global state and fix reset