more refactoring changes
more refactoring changes 2.
admin menu rendering code moved to a different file