Some cleanups in http module