Code Refactored - Menu Bar Functionality