some minor changes
refactored the menu bar functions