remove redundant keywords and modify empty menu handling