use injection for HttpServer and code clean up