Improved user login and templating