removed duplication in generator