You dereference `response.headers()` every single time. Cache it in the local variable.