refactor(id): externalize state
refactor(remote): externalize state