factor out global storage var