Refactoring RandomHelper