do some small code improve for http request