Refactors random generation logic