refacored for menu system