tidied up login