Improve random weighted object implementation