refactoring menu selector