Refactor globals.