Improved transition between login and user account

and removed unused code