Simplify array creation in random generation