Improve loggin in and out