Improve double generator
Add random element helper