Replication logic (incomplete)