some minor changes

• use appropriate string functions
• simplified regexps
• use a labeled block instead of a bool for auth data