rewrite replication sections