Is there any particular reason for this to be global and not inside the functions?