Don't use global variables, modernize