Minimized the amount of global state.