splitted generator
fixed shallow copy in template