improve menu array handling