Use templates for random_choose() to eliminate the need for multiple definitions.