chore(raft_server): Pull deeply nested logic into functions

refactor the startup logic so that the logic doesn't nest 5+ levels
deep.