Guard against stale repl connections
Refactor: better names and responsibilities