Bit of cleanup: remove unused variables, make varaibles that don't need to be class members local to a function.