logout process review refactorings