(refactor) randomFactory refactor