Refactored globals per friends suggestion