It seems as if we are accumulating a lot of similar code related to `menu_position` in different modules.

It would be nice to have this generalized into a few generalized function in a shared module.