Add results_per_race option for competitions. Clean up duplicated code