Refactored how clicking on menu items work