Refactor state-watcher, update-history only once per step, so write to storage only once per step