refactor httpsrv