Reduce amount of global variable usage