Overhaul: nice trick with globals