refactor of login and loading rootview, menu fix not to load rootview multiple times