Change Terminal::logout + small refactoring