Converted instance variables to local variables and removed commented code