Refactor to use a single global