MULE-8018: Merge http connector code cleanup

Will see if makes sense to move it elsewhere but makes no harm to reference that here.