Change whichFactory from int to enum