migrate static vars into main()