Initial implementation of replication