refactored login component