Merged most globals into one var block.

It's more idiomatic this way.