authentication feature refactored