Make vertical menu code more modular, easier to maintain