Improve code organization for the random module (GH-21161)

1 file changed