fix an issue with the collapsible menu
make code more modular, JSON-friendly, and responsive