paxos: refactor