refactor http_basic_auth