split raft server logic into separate module