added menu
refactoring code