small http server refactor