refactored codes for login of crowdie/merchant