Refactored login view