Make more global variables local