refactor generators into separate class