Refactored the random number code into a separate service