Login controller refactor