Minor: use .orNull
Minor: use final
Minor: use template
Minor: indent
Fix #1933 "Incorrect check on headers in Connection"

- clarify method names to reflect header case and use
- indent