Refactorize prngs.cpp