The dynamic menu system badly needs refactoring.