raft: refactor recover