refactored random generators