refactory of menu & dict