Cleaning code, implementing BASIC authentication method