Refactor Login Controller