Patch Set 1: I would prefer that you didn't submit this

(3 inline comments)

Good idea to clean this up.

This change has quite a number of pure formatting changes, maybe these could be factored out into a separate change only having formatting changes. Also the new menu contributions don't seem to be related to this refactoring but deserve another change