refactor replicator