refactored out global variables