menu rendering refactoring