menu: refactoring (close #363)

Close #363