headers.getAll is already case insensitive
Reorganize handleResponseAndExit into smaller methods, first take
Collapse static imports