Reduce amount of global variables