moved command logic out of Menu