It'd be nice if this wasn't a global, perhaps in another refactor.