Generate factories.