Improved performace

It's best to access local variables than global