MADS: Refactor a bit the calls of generateRandom()