Melt the butter and put aside to cool (for ease I did this in the microwave)
Preheat oven to 180 degrees fan forced, and arrange rank into middle of oven
Grease and line a 24cm (base measurement) round cake tin
Place dry ingredients, except the walnuts if using, into a bowl and use a whisk to lightly blend together
Place "pie apple" pieces or fresh apple pieces into a separate large bowl (this is where you will do your mixing)
Add eggs and vanilla to melted butter and mix together well with a fork
Pour the egg mixture over the apple, and add in the walnuts if using, and stir lightly to combine
Add the dry ingredients to the apple mix and mix well together
Place batter into cake tin and level top (if using fresh apple the batter will be a little stiffer so ensure you lightly press it into the base of the tin to get to all the edges)
Put tin into oven and bake for 1 hour and 20 minutes, test, then add another 5 to 10 minutes if necessary (it takes exactly 1 hour and 30 minutes in my oven but test a touch early just in case)
Remove cake from oven and allow to rest for 30 minutes in tin before turning out onto a cake rack to cool completely
Dust with cinnamon sugar and serve