A new geometrical look at Ostrogradsky procedure