refactor(remote): externalize state