Login/Logout refactorings