Preheat the oven to 180 degrees C
Heat the olive oil in a large frying pan
Add the leeks
Cook the leeks until soft and the rings fall apart
Peel the potatoes and thinly slice
Place in a large saucepan and cover with boiling water
Simmer for 7 minutes until softening
Mix the milk in with the creme fraiche. Pour milk over the top, ensuring it almost covers the leek and potatoes
Grease a casserole or large baking dish
Place a layer of potatoes on the bottom
Spoon over one half of the leeks
Sprinkle with one third of the cheese
Add half the ham, if using
Spoon half the creme fraiche and milk mix
Add another layer as above
Top with final layer of potatoes and a sprinkling of cheese
Retain 1/4 of the cheese to sprinkle over towards the end of baking time
Cover and bake for 45 minutes
After 45 minutes remove from oven and remove cover and sprinkle with remaining cheese
Replace in oven uncovered for 10 minutes
Check potatoes are soft and fully cooked, if not return to oven for further time, checking occasionally