refactor logout
refactor logout