- code cleanup.
- added openmenu by state