minor optimisation for Path generation