refactoring speciment generation