refactor of authentication and html-templates into separate modules