Automatic rearrange logic added to menu items.