Favor local vars for highly used globals

I think it's good, let me know what you think :-)