Added a submenu and refactored the code a bit