A new geometrical look at Ostrogradsky’s procedure