Convert globals into constant

Results in 20% faster code