Split off Login, cleaned up some stuff.