Global state factored out.
Local storage