Reorganized menu functio