More refactoring. Mostly, a better way to do random choices.