basic authentication, refactored htmlgenerator