GeneratorFactory - refactored code, added more detailed unit tests