Heat the oil in a large pan over high heat. Brown the mince in two or three batches so it fries rather than stews, then set aside. In the same pan, soften the onion, carrot and celery for 6-8 minutes, then add the garlic and cook for a further minute.
Return the beef to the pan. Stir in the tomato purée and flour and cook for 1-2 minutes. Gradually add the stock and wine, stirring to avoid lumps, then add the Worcestershire sauce, bay leaves and thyme. Simmer uncovered for 20-25 minutes until thickened and rich. Season to taste and remove the bay leaves.
While the filling simmers, boil the potatoes in salted water for 15-18 minutes until tender. Drain well, then mash thoroughly with the butter and warm milk until smooth. Season with salt and white pepper.
Preheat the oven to 200°C (180°C fan). Let the filling cool for 5-10 minutes, then spoon it into a baking dish. Spread the mash evenly over the top, right to the edges, then rough up the surface with a fork. Scatter over the grated cheese, if using.
Bake for 25-30 minutes, until the top is golden brown and the filling is bubbling at the edges. Rest for 5 minutes before serving.