cleaned the code in the HTTP Handler