removed check for getallheaders(), minor refactor