Some login stuff, some layout stuff, some magic.