Made unnecessary instance variables to local variables

Made unnecessary instance variables to local variables