I don't fully understand the menu id code, but it looks like the issue here is that the menuItemID passed into `removeMenuDivider` includes the parent menu id at the beginning (because it's coming from the menuItemMap), so you need to strip that off. If so, then I'm a little concerned that just looking for `indexOf("brackets")` isn't safe, because it's possible that the parent menu id might contain the string "brackets". Perhaps it would be safer to use `lastIndexOf("brackets")` since we know that divider ids only have "brackets" at the beginning.

I think it would be better, though, to just redefine `removeMenuDivider()` to take the child menu id, and strip off the parent menu id in the loop that calls `removeMenuDivider()`, since you have that information there. It looks like `removeMenuDivider()` is actually a private function anyway (it's not in `exports`) so it should be fine to change the semantics of the parameter. (If you do, you should probably change the parameter name as well, for clarity.)