refactored login once more