Refactor Login
Refactor Logout