Made Login code a little cleaner