replication routing logic first version