refactor create basic auth string to private method