Replication tree is now a routine

Replication tree is now a routine