Refactored controllers for Login and Regis