Optimise RepeatCommand slightly