Refactoring to remove duplication from compose and recompose generators.
Wrong merge