Login
A little more tweaking. Should probably write some unit tests here.