Made the selector more type specific, and added events to handle the menu item actions.