clean replication module code