incremental step to window state persistence refactor.