Refactored login models and views.