Refactor defaulthandler and FileServer.HandleRequest