Refactoring globals