Move rng to util & make it faster