Handle logouts
Refactor variable name
Refactor by changing factory methods by a factory class
More factory refactorings