fix(generator) Fix incorrectly generated factory