Removing set but not used variables and not used variables