Using logic in the data replication