enhance login and registration logic
merge