Refactor logout code.