added menu factory and menuToggle method