replicate on interface instead of template
some simplications on generating values