01 - Preheat the oven to 400°F.
02 - Boil peeled and cubed potatoes in salted water until tender, approximately 15 to 20 minutes. Drain thoroughly.
03 - Mash the drained potatoes with butter and milk until smooth. Season with salt and pepper, then incorporate the egg yolk if desired. Set aside.
04 - Heat olive oil in a large skillet over medium heat. Add chopped onion, minced garlic, and diced carrots, then sauté until softened, about 5 minutes.
05 - Add ground beef to the skillet, breaking it apart as it cooks. Continue cooking until browned and fully cooked, around 7 to 8 minutes.
06 - Stir in tomato paste, Worcestershire sauce, dried thyme, dried rosemary, salt, and black pepper. Cook the mixture for 2 minutes.
07 - Sprinkle the all-purpose flour over the filling and mix well. Cook for 1 minute to remove raw flour taste.
08 - Pour in the beef broth, stirring and scraping the pan to loosen browned bits. Simmer for about 5 minutes until the mixture thickens slightly.
09 - Stir frozen peas into the filling and cook for an additional 2 minutes.
10 - Transfer the beef filling to a large baking dish. Evenly top with mashed potatoes, spreading smoothly. Use a fork to create a decorative pattern if preferred.
11 - Bake uncovered for 20 to 25 minutes, until the topping is golden brown and the filling is bubbling.
12 - Allow the dish to rest for 10 minutes before serving to set.