Refactor to avoid caching ivars across requests