formatted and refactored BasicAuth Class