Login Controller refactoring