Adding 3 utility functins to deal with replication