ver2.3.1 change the code to the factory random methods