add a parameter to adjust random generation methods

- also remove an obsolete function and some other cleanups