Log out and Refactoring