Removing unused variables and commented out code