Fix login integration
Refactoring