select menu options depending on URL, refactoring