Moved loginCtrl into a seperate file