remote: refactor for ReadLocalState