Removing unused variables and methods