implements effect replicate
Common header for all effect
Some refactoring