Cleaning up basic authentication code.