Restructure of Login Model and Controller