templates for supporting different random number generators