improve random performance