Generalize dice factory