Extract randomInt to an anonymous function in Util.Generator