Refactor web server loading